Automatic optimization method for MySQL (My Structured Query Language) slow query statement, computer equipment and storage medium
An automatic optimization and slow query technology, applied in the field of database management, can solve problems such as low efficiency and achieve the effect of improving work efficiency
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0071] see figure 1 , the present embodiment is applied in the OLTP system, and the MySQL slow query statement automatic optimization method provided by the present embodiment includes the following steps:
[0072] S101. Obtain the slow query statement through the slow query SQL acquisition function;
[0073] Specifically, acquiring slow query statements through the slow query SQL acquisition function may include but not limited to:
[0074] First obtain the slow query statements from the slow query file. In actual operation, you can obtain the slow query statements one by one and then optimize them one by one, or you can obtain all the slow query statements at once and then optimize them one by one. There are not too many restrictions here;
[0075] Then save each slow query statement line by line in the table of the database, wherein the information of each line of the table includes but not limited to SQL content, query time, running time, lock time, number of scanned rows...
Embodiment 2
[0119] see figure 2 , the present embodiment is applied in the OLTP system, and the MySQL slow query statement automatic optimization device provided by the present embodiment includes:
[0120] An acquisition module 201, configured to acquire a slow query statement through a slow query SQL acquisition function;
[0121] Specifically, the obtaining module 201 is used to obtain the slow query statement through the slow query SQL obtaining function, which specifically includes:
[0122] Used to obtain slow query statements from slow query files;
[0123] It is used to save the slow query statement in a table of the database, wherein the information of each row of the table includes SQL content, query time, running time, lock time, number of scanned rows and number of sent rows.
[0124] The checking module 202 is used to check the number of rows and statement content of the slow query statement through the slow query SQL preliminary analysis function, and store the check resu...
Embodiment 3
[0136] This embodiment provides a computer-readable storage medium 300, the computer-readable storage medium 300 stores a computer program 311, and the computer program 311 implements the following steps when executed by a processor:
[0137] Obtain the slow query statement through the slow query SQL acquisition function;
[0138] Check the row number and statement content of the slow query statement by the slow query SQL preliminary analysis function, and store the check result in the tuning result set;
[0139] Obtain the execution plan of the slow query statement through the execution plan acquisition function;
[0140] Check the index and table structure of the execution plan through the execution plan analysis function, and store the check result in the tuning result set;
[0141] If the tuning result set is empty, obtain a preset number of rewritten SQL statements through the SQL statement rewriting function, and store them in the tuning result set;
[0142] The tuning...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com