Database performance parameter optimization method and device and electronic equipment

By collecting and analyzing performance data for distributed databases, calculating the comprehensive evaluation index value, and using the prediction model for iterative optimization, the parameter tuning problem caused by the complexity of the distributed database architecture is solved, and efficient database performance optimization is achieved.

CN119807166AActive Publication Date: 2025-04-11JINZHUAN INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411786864.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-11
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

The complexity of distributed database architecture makes it difficult to tune database performance parameters, and the existing technology is difficult to effectively collect and analyze performance consumption information during execution, resulting in low parameter tuning efficiency.

Method used

By inputting each SQL statement in the SQL statement set to the initial database, running data including detailed execution time and server performance consumption of each node are collected to form a first data set. After classifying and summarizing the data, the comprehensive evaluation index value of each type of SQL is calculated, and the parameter set to be optimized is selected from the full parameters. The comprehensive evaluation index value and parameter set are input into the prediction model, and the parameter set after the initial optimization is generated, and through multiple rounds of iterative optimization, the optimal parameter set is finally obtained.

Benefits of technology

It has achieved comprehensive collection of performance data and SQL time-consuming, accurately positioning performance bottlenecks, focusing on key parameters, avoiding blind tuning, and automatically adjusting parameters with prediction models to improve tuning efficiency, ensure continuous improvement of database performance, meet the needs of complex business scenarios, and significantly reduce the difficulty of tuning under distributed architectures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807166A_ABST
    Figure CN119807166A_ABST
Patent Text Reader

Abstract

The invention relates to a database performance parameter optimization method and device and electronic equipment. The method comprises the following steps: inputting each SQL statement in an SQL statement set into an initial database, and outputting operation data of each SQL statement to obtain a first data set; classifying and summarizing the first data set to obtain operation data of each type of SQL statements, and calculating to obtain a comprehensive evaluation index value of each type of SQL statements; according to the first data set, a first parameter set needing to be optimized is analyzed from a full-amount parameter set of the initial database; inputting all the comprehensive evaluation index values and the first parameter set into a prediction model to obtain a second parameter set after primary optimization; and using the initial database and the prediction model to perform multiple iterative optimization on the second parameter set to obtain an optimal parameter set of the initial database. According to the method and the device, the technical problem of high parameter tuning difficulty caused by complexity of a distributed database architecture is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of distributed databases, and in particular to a method, device and electronic device for optimizing database performance parameters. Background Art

[0002] Distributed databases are widely used in modern business, and they are mainly used to achieve efficient operation through the layered design of the computing engine layer and the data storage layer. In this architecture, each layer is composed of multiple nodes, which can process business statements concurrently, thereby achieving near-linear performance improvement when the business volume increases. This scalability makes distributed databases the preferred technical solution for large-scale, high-concurrency scenarios. However, the complexity of the distributed architecture also brings significant challenges, especially in database performance optimization. Since SQL execution involves multiple nodes and multiple layers, performance is limited by many factors such as coordination between nodes, resource allocation, and hardware bottlenecks. At the same time, the interaction between components at each layer makes the problem troubleshooting and optimization process more complicated, and often requires comprehensive analysis of multi-dimensional performance indicators including CPU, memory, disk IO, and network bandwidth. This multi-factor coupling relationship makes database parameter tuning extremely difficult. It not only needs to be refined to the specific execution stage, but also needs to be comprehensively debugged and optimized in combination with server performance, which requires a lot of human analysis costs. Therefore, how to effectively collect and analyze performance consumption information during execution and accurately tune parameters based on this data is an urgent problem to be solved in the current distributed database optimization. Summary of the invention

[0003] The present application provides a method, device and electronic device for optimizing database performance parameters to solve the technical problem of difficulty in parameter tuning due to the complexity of distributed database architecture.

[0004] In a first aspect, the present application provides a method for optimizing database performance parameters, comprising: inputting each SQL statement in an SQL statement set into an initial database so that the initial database executes each SQL statement and outputs operation data of each SQL statement to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the operation data includes the initial database executing the SQL statements, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statements at each node; classifying and summarizing the first data set to obtain the operation data of each type of SQL statements, and calculating the comprehensive evaluation index value of each type of SQL statements based on the operation data of each type of SQL statements; analyzing the first parameter set to be optimized from the full parameter set of the initial database based on the first data set; inputting all the comprehensive evaluation index values ​​and the first parameter set into a prediction model so that the prediction model performs a primary optimization on the first parameter set based on all the comprehensive evaluation index values ​​to obtain a second parameter set after the primary optimization; and performing multiple iterative optimizations on the second parameter set using the initial database and the prediction model to obtain the optimal parameter set of the initial database.

[0005] In a second aspect, the present application provides a device for optimizing database performance parameters, including: an execution module, used to input each SQL statement in a SQL statement set into an initial database, so that the initial database executes each SQL statement, and outputs the operation data of each SQL statement to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the operation data includes the initial database executing the SQL statements, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statements at each node; a calculation module, used to classify and summarize the first data set to obtain each type of SQL statement , and according to the running data of each type of SQL statement, calculate the comprehensive evaluation index value of each type of SQL statement; an analysis module, used to analyze the first parameter set that needs to be optimized from the full parameter set of the initial database according to the first data set; a first optimization module, used to input all the above comprehensive evaluation index values ​​and the above first parameter set into the prediction model, so that the above prediction model performs an initial optimization on the above first parameter set according to all the above comprehensive evaluation index values, and obtains a second parameter set after the initial optimization; a second optimization module, used to perform multiple iterative optimizations on the above second parameter set using the above initial database and the above prediction model, and obtain the optimal parameter set of the above initial database.

[0006] As an optional example, the above-mentioned calculation module includes: a first acquisition unit, used to obtain the execution plan tree generated by the above-mentioned initial database when executing each of the above-mentioned SQL statements; a classification unit, used to classify all the above-mentioned SQL statements according to the fingerprint of the execution plan tree of each of the above-mentioned SQL statements, and obtain multiple categories of SQL statements; a first aggregation unit, used to aggregate the running data of each of the above-mentioned SQL statements in the target class SQL statements, and obtain the running data of the above-mentioned target class SQL statements, wherein the above-mentioned target class SQL statements are any one category of SQL statements among the multiple categories of SQL statements.

[0007] As an optional example, the above-mentioned device also includes: a removal module, which is used to remove all abnormal values ​​in the above-mentioned first data set through an adaptive algorithm before calculating the comprehensive evaluation index value of each type of SQL statement based on the running data of each type of SQL statement to obtain an updated first data set.

[0008] As an optional example, the above-mentioned calculation module includes: a processing unit, which is used to take each type of SQL statement as a current type of SQL statement, and perform the following steps on the above-mentioned current type of SQL statement: obtain the performance consumption data and detailed execution time of each execution stage of the above-mentioned current type of SQL statement, and convert them into comparable units; assign weight factors to the performance consumption data and detailed execution time of each execution stage of the above-mentioned current type of SQL statement; multiply the performance consumption data and detailed execution time of each execution stage of the above-mentioned current type of SQL statement by the corresponding weight factors respectively, and obtain the weighted results of each execution stage of the above-mentioned current type of SQL statement; sum the weighted results of each execution stage of the above-mentioned current type of SQL statement to obtain the comprehensive evaluation index value of the above-mentioned current type of SQL statement.

[0009] As an optional example, the above-mentioned analysis module includes: a first determination unit, used to determine the bottleneck stage according to the above-mentioned first data set; a screening unit, used to screen out a third parameter set related to the above-mentioned bottleneck stage from the above-mentioned full parameter set; a second determination unit, used to determine the optimization range of each parameter in the above-mentioned third parameter set; a second summary unit, used to summarize the above-mentioned third parameter set and the optimization range of each parameter thereof to obtain the above-mentioned first parameter set.

[0010] As an optional example, the second optimization module includes: a second acquisition unit, used to acquire a second parameter set and a database used for the Mth optimization, wherein the M is a positive integer greater than 1, when the M is 2, the second parameter set used for the Mth optimization is the second parameter set after the initial optimization, and the database used for the Mth optimization is the initial database, and when the M is greater than 2, the second parameter set used for the Mth optimization is the second parameter set after the M-1th optimization, and the database used for the Mth optimization is the database after the M-1th optimization; a first optimization unit, used to optimize the database used for the Mth optimization according to the second parameter set used for the Mth optimization, and obtain the database after the Mth optimization. a database; a computing unit, used for recalculating the comprehensive evaluation index value of each type of SQL statement based on the above-mentioned SQL statement set and the above-mentioned database after the M-th optimization, to obtain the comprehensive evaluation index value of each type of SQL statement after the M-th optimization; a second optimization unit, used for inputting all the above-mentioned comprehensive evaluation index values ​​after the M-th optimization and the second parameter set used for the above-mentioned M-th optimization into the above-mentioned prediction model, so that the above-mentioned prediction model optimizes the second parameter set used for the above-mentioned M-th optimization according to all the above-mentioned comprehensive evaluation index values ​​after the M-th optimization, to obtain the second parameter set after the M-th optimization, updates M=M+1, and performs the M+1-th optimization until the above-mentioned M is equal to the target threshold value, to obtain the above-mentioned optimal parameter set.

[0011] As an optional example, the above-mentioned computing unit includes: an execution subunit, used to input each SQL statement in the above-mentioned SQL statement set into the above-mentioned database after the M-th optimization, so that the above-mentioned database after the M-th optimization executes each of the above-mentioned SQL statements, and outputs the running data of each of the above-mentioned SQL statements to obtain the first data set after the M-th optimization; a computing subunit, used to classify and summarize the above-mentioned first data set after the M-th optimization to obtain the running data of each type of SQL statements, and calculate the comprehensive evaluation index value of each type of SQL statements after the M-th optimization based on the running data of each type of SQL statements.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned method for optimizing database performance parameters when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for optimizing database performance parameters through the computer program.

[0014] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0015] The present application adopts the method of inputting each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement, and outputs the operation data of each SQL statement, to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the operation data includes the initial database executing the SQL statements, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statements at each node; the first data set is classified and summarized to obtain the operation data of each type of SQL statements, and the comprehensive evaluation index value of each type of SQL statements is calculated according to the operation data of each type of SQL statements; According to the above-mentioned first data set, the first parameter set to be optimized is analyzed from the full parameter set of the above-mentioned initial database; all the above-mentioned comprehensive evaluation index values ​​and the above-mentioned first parameter set are input into the prediction model, so that the above-mentioned prediction model performs the initial optimization of the above-mentioned first parameter set according to all the above-mentioned comprehensive evaluation index values, and obtains the second parameter set after the initial optimization; the above-mentioned initial database and the above-mentioned prediction model are used to perform multiple iterations of optimization on the above-mentioned second parameter set to obtain the method of the optimal parameter set of the above-mentioned initial database, because in the above-mentioned method, each SQL statement in the SQL statement set is input into the initial database for execution, and the operation data including detailed execution time, server performance consumption of each node, etc. are collected to form the first data set. After the data is classified and summarized, the comprehensive evaluation index value of each type of SQL is calculated, and the first parameter set to be optimized is screened out from the full parameter set. Subsequently, the comprehensive evaluation index value and the first parameter set are input into the prediction model to generate the second parameter set for the initial optimization. After multiple rounds of iterative adjustment, the optimal parameter set is finally obtained, thereby realizing the comprehensive collection of performance data and SQL time consumption, accurately locating performance bottlenecks, focusing on key parameters, avoiding blind tuning, and automatically adjusting parameters in combination with the prediction model to improve tuning efficiency. Multiple rounds of iterative optimization ensure that database performance continues to improve, meet the needs of complex business scenarios, and significantly reduce the difficulty of tuning under the distributed architecture, thereby solving the technical problem of difficulty in parameter tuning due to the complexity of the distributed database architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0019] Figure 1 is a flowchart of an optional method for optimizing database performance parameters according to an embodiment of the present application;

[0020] Figure 2 is an architectural diagram of an optional method for optimizing database performance parameters according to an embodiment of the present application;

[0021] Figure 3 is a flowchart of an implementation method of an optional database performance parameter optimization method according to an embodiment of the present application;

[0022] Figure 4 It is an analysis flow chart of a log analysis module of an optional method for optimizing database performance parameters according to an embodiment of the present application;

[0023] Figure 5 is an analysis flow chart of an analysis processing module of an optional database performance parameter optimization method according to an embodiment of the present application;

[0024] Figure 6 is a schematic structural diagram of an optional database performance parameter optimization device according to an embodiment of the present application;

[0025] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0027] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0028] According to a first aspect of an embodiment of the present application, a method for optimizing database performance parameters is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0029] S102, input each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement, and outputs the running data of each SQL statement, to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the running data includes the initial database executing the SQL statement, the performance consumption data of the server of each node of the initial database, and the detailed execution time of the SQL statement at each node;

[0030] S104, classifying and summarizing the first data set to obtain operation data of each type of SQL statement, and calculating a comprehensive evaluation index value of each type of SQL statement based on the operation data of each type of SQL statement;

[0031] S106, analyzing a first parameter set to be optimized from all parameter sets in the initial database according to the first data set;

[0032] S108, inputting all comprehensive evaluation index values ​​and the first parameter set into the prediction model, so that the prediction model performs a primary optimization on the first parameter set according to all comprehensive evaluation index values, and obtains a second parameter set after the primary optimization;

[0033] S110, performing multiple iterations of optimization on the second parameter set using the initial database and the prediction model to obtain an optimal parameter set of the initial database.

[0034] Optionally, in this embodiment, if Figure 2The architecture diagram shown includes an application (APP), a database, a log analysis module, and an analysis and processing module. The application is used to issue business statements or SQL statements. The database is responsible for storing business data, executing business SQL statements, and returning execution results. Distributed databases are generally divided into a computing engine layer and a data storage layer, and each layer is divided into multiple nodes to concurrently process business statements, thereby achieving a great near-linear improvement in business performance. The log analysis module receives the performance consumption data of the server of each node of the database uploaded by the database and the detailed execution time data of the SQL statement at each node, parses the SQL statement to generate an execution plan tree, classifies the SQL statement according to the fingerprint of the execution plan tree, and analyzes the time-consuming bottlenecks and performance consumption of various SQL statements, which are used as control indicators. Finally, the time-consuming and performance consumption of each execution stage of various SQL statements are summarized and calculated, and the time-consuming bottlenecks and performance consumption of SQL statements are intuitively displayed. The analysis and processing module forms a preliminary optimization plan and related parameter sets based on the time-consuming bottlenecks and performance consumption of various SQL statements transmitted by the log analysis module, continuously adjusts the values ​​of the input parameter sets, verifies the execution results and collects the time-consuming and performance consumption, evaluates the optimization effect, and updates the parameter prediction model. After multiple comparative tests, the parameter prediction model became more perfect, and finally the best parameter tuning plan and parameter set were output.

[0035] Optionally, in this embodiment, if Figure 3As shown in the implementation flow chart, specifically, the application inputs each SQL statement of various types of business SQL statements in the SQL statement set into the initial database with pre-set base data in turn, prompting them to be executed one by one, covering all business scenarios as much as possible, and issuing them as many times as possible, so that the statistical information is more accurate. In this process, the database records the running data of each SQL statement, including the execution time and the server performance consumption (such as CPU, memory, disk IO, network bandwidth, etc.) of each node in the initial database, as well as the detailed execution time of the SQL statement at each node, which is refined to each specific execution stage. These data constitute the first data set and are uploaded to the log analysis module in time. The log analysis module parses each SQL statement to generate an execution plan tree, classifies and summarizes the running data of the SQL statement according to the fingerprint of the execution plan tree of the SQL statement, and intuitively displays the time-consuming bottleneck of the SQL statement and the performance consumption. The analysis and processing module receives the classified and summarized running data of various types of SQL statements, and calculates the comprehensive evaluation index value of each type of SQL statement. The index value combines the execution time and performance consumption to provide a quantitative basis for performance evaluation. Based on the first data set, analyze the database parameters that have a significant impact on performance bottlenecks, and select the first parameter set that needs to be optimized from the full parameter set. These parameters are usually related to the key stages of SQL execution, such as index configuration, cache settings, parallelism, etc. Input the first parameter set and the comprehensive evaluation index values ​​of various SQLs into the prediction model. The prediction model optimizes the first parameter set through preliminary analysis and generates the second parameter set after the initial optimization, that is, the improvement suggestions based on the current performance data. Use the prediction model and the initial database to perform multiple rounds of optimization on the second parameter set, gradually adjust the parameter values ​​and verify the optimization effect. After each iteration, the prediction model adjusts the optimization direction according to the new performance data and finally generates the optimal parameter set.

[0036] Optionally, in this embodiment, based on a comprehensive analysis of SQL execution data and node performance consumption, performance bottlenecks can be accurately identified, such as high consumption of specific node resources or execution delays of specific SQL types. By screening and optimizing the first parameter set, the optimization process focuses on the key parameters that have the greatest impact on performance, avoiding the blindness and inefficiency of full parameter tuning. Combined with the automated optimization and iterative analysis of the predictive model, the time and workload of manual parameter adjustment are greatly reduced, improving the tuning efficiency. Multiple rounds of iterative optimization ensure that the parameter configuration of the database is close to the optimal performance, adapts to the needs of diverse business scenarios, and improves the overall operating efficiency of the distributed database.

[0037] As an optional example, the first data set is classified and summarized to obtain the running data of each type of SQL statement, including:

[0038] Get the execution plan tree generated by the initial database when executing each SQL statement;

[0039] According to the fingerprint of the execution plan tree of each SQL statement, all SQL statements are classified to obtain multiple categories of SQL statements;

[0040] The running data of each SQL statement in the target class SQL statement is aggregated to obtain the running data of the target class SQL statement, wherein the target class SQL statement is any one class of SQL statements among multiple classes of SQL statements.

[0041] Optionally, in this embodiment, if Figure 4 The analysis flow chart of the log analysis module shown in FIG. 1 shows that, specifically, when the database executes each SQL statement, the system generates a corresponding execution plan tree, which describes the execution process of the SQL statement in detail, including operation steps (such as index scan, table scan, connection operation, etc.) and resource allocation (such as CPU, memory, etc.). These plans are key data structures in the SQL statement execution process, which can reflect the execution efficiency and potential bottlenecks. The SQL statements are classified using the execution plan tree fingerprint of each SQL statement. The execution plan tree fingerprint is a feature identifier that can uniquely represent the core pattern of the SQL statement execution logic structure. By classifying the fingerprints, SQL statements with similar execution logic can be classified into one category to form multiple categories of SQL statements. For the target class SQL statement (any one of the multiple categories of SQL), the running data of all SQL statements in this category (such as node performance consumption, execution time, etc.) are summarized. The summary results include average values, peak values, distribution statistics, etc., providing a full picture of the overall performance of the target class SQL statement.

[0042] Optionally, in this embodiment, based on the execution plan tree classification, the optimization requirements of different SQL types can be accurately focused to avoid "one-size-fits-all" generalized tuning and improve pertinence. The summary analysis of similar SQL can discover patterned performance bottlenecks (such as invalid specific indexes, resource contention, etc.) and provide data support for optimization. The summary process covers multi-dimensional performance data to make the results more representative and facilitate the subsequent calculation of comprehensive evaluation indicators and the design of performance optimization solutions. The classified and summarized data provides high-quality input for subsequent prediction models, improving the accuracy and iteration effect of parameter optimization.

[0043] As an optional example, before calculating the comprehensive evaluation index value of each type of SQL statement according to the running data of each type of SQL statement, the above method further includes:

[0044] All outliers in the first data set are removed by an adaptive algorithm to obtain an updated first data set.

[0045] Optionally, in this embodiment, there may be a variety of outliers in the first data set, such as sudden server resource occupancy (other task interference), network fluctuations, hardware failures, etc., which cause glitches and data information of special circumstances. These outliers may seriously deviate from the normal data distribution and mislead the analysis results. Therefore, before the log analysis module classifies the first data set, it uses an adaptive algorithm (such as least squares method, least mean square algorithm, Wiener filtering, etc.) to dynamically identify and remove outliers. The adaptive algorithm can automatically adjust parameters according to the statistical characteristics of the data (such as distribution, trend), ensuring that normal data is retained while removing outliers. After removing the outliers, the first cleaned data set is obtained, and its data is more real and reliable, and can accurately reflect the actual performance of the database operation.

[0046] Optionally, in this embodiment, after removing the outliers, the data distribution is more reasonable, the interference of outliers on the statistical results is avoided, and the accuracy of the classification and summary of the operation data is improved. The wrong decisions that may be caused by outliers are eliminated, and the comprehensive evaluation indicators and optimization strategies are ensured to be based on normal operation data, thereby improving the overall analysis effect. Data cleaning reduces the calculation deviation caused by outliers, makes the direction of subsequent performance optimization clearer, and reduces the probability of invalid optimization.

[0047] As an optional example, according to the running data of each type of SQL statement, the comprehensive evaluation index value of each type of SQL statement is calculated, including:

[0048] Take each type of SQL statement as the current type of SQL statement and perform the following steps on the current type of SQL statement:

[0049] Get the performance consumption data and detailed execution time of each execution stage of the current SQL statement, and convert them into comparable units;

[0050] Assign weight factors to the performance consumption data and detailed execution time of each execution stage of the current SQL statement;

[0051] Multiply the performance consumption data and detailed execution time of each execution stage of the current SQL statement by the corresponding weight factor to obtain the weighted result of each execution stage of the current SQL statement;

[0052] The weighted results of each execution phase of the current SQL statement are summed to obtain the comprehensive evaluation index value of the current SQL statement.

[0053] Optionally, in this embodiment, if Figure 5The analysis flow chart of the analysis and processing module shown in the figure, specifically, for the running data of each type of SQL statement, the performance consumption data (such as CPU, memory, disk I / O, network bandwidth, etc.) and detailed execution time generated in different execution stages (such as parsing, optimization, plan generation, execution, etc.) are extracted. These data fully reflect the resource usage and performance of SQL at each stage. The performance consumption data and detailed execution time are converted into comparable units (such as converted to percentages or normalized to the [0,1] interval) and standardized into the same dimension (such as converting memory consumption into MB / s and time into milliseconds / ms) to maintain consistency in subsequent calculations and avoid distortion of results due to inconsistent units. According to business needs or actual scenarios, different weight factors are assigned to each execution stage of the SQL statement. The weight factor indicates the importance of each stage to the comprehensive evaluation of the SQL statement. For example, if the business pays more attention to the execution speed, the weight factor of the execution time may be higher, while for resource-constrained scenarios, the weight factor of performance consumption may be higher. The performance consumption data and detailed execution time of each execution stage of each type of SQL statement are multiplied by the corresponding weight factor to obtain the weighted results of each execution stage. This process combines the importance of different stages and makes the evaluation results more in line with business reality. The weighted results of each execution stage of each type of SQL statement are summed to obtain the comprehensive evaluation index value of this type of SQL statement. This index is a quantitative evaluation of the overall SQL performance, which comprehensively reflects the execution efficiency and rationality of resource use.

[0054] Optionally, in this embodiment, various types of performance data and time-consuming indicators are unified into comparable values ​​through unit conversion and weighted calculation, so that the evaluation results have standardized characteristics, which is convenient for horizontal comparison between SQL types. The setting of weight factors can be flexibly adjusted according to different business scenarios to make the evaluation indicators more in line with actual needs, such as increasing the focus on execution efficiency or resource consumption. The comprehensive evaluation index value can help quickly discover the main performance bottlenecks of a certain type of SQL (such as excessive resource consumption or long time consumption in a specific stage), and provide a clear direction for subsequent optimization. The evaluation index provides a quantitative basis for SQL classification optimization and parameter tuning, simplifies the optimization process, and improves the tuning efficiency and effect.

[0055] As an optional example, according to the first data set, analyzing the first parameter set to be optimized from the full parameter set of the initial database includes:

[0056] According to the first data set, a bottleneck stage is determined;

[0057] Filter out the third parameter set related to the bottleneck stage from the full parameter set;

[0058] determining an optimization range for each parameter in the third parameter set;

[0059] The third parameter set and the optimization range of each parameter thereof are summarized to obtain the first parameter set.

[0060] Optionally, in this embodiment, if Figure 5 The analysis flow chart of the analysis and processing module shown in the figure, specifically, according to the first data set (including the performance consumption data and detailed execution time of SQL execution), the distribution of time consumption and resource consumption of each execution stage (such as parsing, optimization, plan generation, execution, etc.) of the database when processing SQL statements is analyzed. By comparing the time consumption ratio and resource consumption ratio of each stage, the bottleneck stage with a greater impact on the overall performance is located. For example, if the time consumption of the execution stage is significantly higher than that of other stages or set values, it can be determined as a bottleneck stage. From the full parameter set of the initial database, the parameters directly related to the bottleneck stage are screened out to form a third parameter set. For each parameter in the third parameter set, the reasonable optimization range is determined in combination with the operating data of the first data set and the database parameter design document. For example, the thread pool size may have an effective range (such as 4-64). Adjusting it too small may lead to insufficient concurrency, and if it is too large, it will consume additional resources. The optimization range can be reduced according to the actual bottleneck and database load. The screened third parameter set and its optimization range are summarized to form the first parameter set. The first parameter set is a subset of the initial database parameters, which is used for iterative parameter optimization and focuses on parameters related to the bottleneck stage. The purpose is to narrow the scope of optimization and improve the efficiency of parameter adjustment.

[0061] Optionally, in this embodiment, the bottleneck stage analysis clarifies the key areas of performance issues, thereby focusing on the most critical parameters and avoiding the complexity of full parameter adjustment. By screening relevant parameters and limiting the optimization range, the set of parameters to be adjusted is narrowed, significantly reducing the time and computing cost of the tuning process. The first parameter set is centered on the bottleneck stage to ensure the pertinence and effectiveness of the optimization, and can quickly achieve performance improvements. The first parameter set is dynamically generated according to different bottleneck stages, so that the optimization process can adapt to different SQL types and operating scenarios, and enhance the tuning flexibility of distributed databases.

[0062] As an optional example, the second parameter set is optimized multiple times by using the initial database and the prediction model, and the optimal parameter set of the initial database includes:

[0063] Obtain the second parameter set and database used for the Mth optimization, wherein M is a positive integer greater than 1. When M is 2, the second parameter set used for the Mth optimization is the second parameter set after the initial optimization, and the database used for the Mth optimization is the initial database. When M is greater than 2, the second parameter set used for the Mth optimization is the second parameter set after the M-1th optimization, and the database used for the Mth optimization is the database after the M-1th optimization.

[0064] According to the second parameter set used in the M-th optimization, the database used in the M-th optimization is optimized to obtain the M-th optimized database;

[0065] Recalculate the comprehensive evaluation index value of each type of SQL statement based on the SQL statement set and the database after the Mth optimization to obtain the comprehensive evaluation index value of each type of SQL statement after the Mth optimization;

[0066] All the comprehensive evaluation index values ​​after the Mth optimization and the second parameter set used in the Mth optimization are input into the prediction model, so that the prediction model optimizes the second parameter set used in the Mth optimization according to all the comprehensive evaluation index values ​​after the Mth optimization, obtains the second parameter set after the Mth optimization, updates M=M+1, and performs the M+1th optimization until M is equal to the target threshold to obtain the optimal parameter set.

[0067] Optionally, in this embodiment, the input of the first optimization is the second parameter set and the initial database after the initial optimization. As the iterative optimization proceeds, the input of the Mth optimization includes the second parameter set generated by the (M-1)th optimization and the database instance generated by the (M-1)th optimization. According to the second parameter set used for the Mth optimization, the Mth database is adjusted, including modifying the configuration parameters (such as parallelism, cache strategy, etc.) and restarting or hot updating the database to generate the database instance after the Mth optimization. The database after the Mth optimization is tested using the SQL statement set, multiple types of SQL statements are run, and the performance data of each type of SQL (time consumption, CPU, memory, disk IO, etc.) is counted, and the comprehensive evaluation index value after the Mth optimization is recalculated according to the weight factor. The comprehensive evaluation index value after the Mth optimization and the current second parameter set are used as input and submitted to the prediction model for processing. The prediction model further adjusts the parameter set by analyzing the change trend of the new index value to generate the second parameter set for the next round of optimization. After each optimization is completed, the number of iterations M is increased by 1, and the next round of optimization is entered with a new parameter set and database instance. Manually monitor and analyze the rationality of the current parameter tuning. If some parameters are unreasonable, manual intervention can be made to change the parameter prediction model to make it more suitable for application requirements. When M reaches the target threshold (such as when the performance is stable or not significantly improved), the iteration is terminated and the final optimal parameter set is output.

[0068] Optionally, in this embodiment, through multiple iterations of optimization, each time a more accurate indicator value is used to guide the next round of parameter adjustment, so as to achieve asymptotic approximation to the optimal parameters. The prediction model can adjust the strategy based on historical optimization data to adapt to different SQL load characteristics and database architecture changes. The optimal parameter set finally output can balance resource utilization and SQL execution efficiency, significantly improve database performance, and ensure stability. Automated iterative optimization is used to reduce the complexity of manual analysis parameters and improve optimization efficiency and accuracy.

[0069] As an optional example, the comprehensive evaluation index value of each type of SQL statement is recalculated based on the SQL statement set and the database after the Mth optimization, and the comprehensive evaluation index value of each type of SQL statement after the Mth optimization is obtained, including:

[0070] Input each SQL statement in the SQL statement set into the database optimized for the Mth time, so that the database optimized for the Mth time executes each SQL statement and outputs the running data of each SQL statement, thereby obtaining a first data set optimized for the Mth time;

[0071] The first data set after the M-th optimization is classified and summarized to obtain the running data of each type of SQL statement, and based on the running data of each type of SQL statement, the comprehensive evaluation index value of each type of SQL statement after the M-th optimization is calculated.

[0072] Optionally, in this embodiment, each SQL statement in the SQL statement set is input into the database after the Mth optimization one by one for execution. In the process of executing the SQL statement, the database records the operation data, including the performance consumption (CPU, memory, disk IO, etc.) of each node, the detailed execution time of the SQL statement at each node, and outputs the operation data to form the first data set after the Mth optimization. The first data set after the Mth optimization is classified according to the execution plan tree fingerprint of the SQL statement, and all SQL statements are divided into multiple categories. The operation data (time consumption and performance consumption) in each category of SQL statements are summarized to obtain the operation data of each category of SQL statements. For the operation data of each category of SQL statements, the performance consumption data and detailed execution time of the execution stage are extracted, and the units are uniformly processed (such as converted into milliseconds, percentages, etc.). The performance consumption data and detailed execution time of each execution stage are multiplied by the corresponding weight factor to obtain the weighted result of each execution stage, and the weighted results of all execution stages are summed to calculate the comprehensive evaluation index value of the current category of SQL statements. Repeat the above process to calculate the comprehensive evaluation index value of all categories of SQL statements to obtain the complete evaluation index after the Mth optimization.

[0073] Optionally, the core of this application is to use the database's time-consuming logs and server performance consumption information to perform data preprocessing, classification, aggregation, calculation and iterative optimization to ultimately obtain the optimal parameter set and its value suitable for the database. Among them, SQL feature classification can also be flexibly adjusted according to other rules, such as specified HINT information, precompiled templated features, etc. The prediction model can use artificial intelligence algorithms, including but not limited to the following two types of alternatives: Model type: supervised learning (such as regression analysis), unsupervised learning (such as clustering), semi-supervised learning, reinforcement learning, etc.; Training algorithm: Combine different algorithms, such as regression algorithms, decision trees, deep learning, association rule learning, etc., to select a suitable optimization method.

[0074] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0075] According to another aspect of the embodiment of the present application, a device for optimizing database performance parameters is also provided. Figure 6 As shown, including:

[0076] An execution module 602 is used to input each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement and outputs the operation data of each SQL statement to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the operation data includes the initial database executing the SQL statement, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statement at each node;

[0077] The calculation module 604 is used to classify and summarize the first data set to obtain the operation data of each type of SQL statement, and calculate the comprehensive evaluation index value of each type of SQL statement according to the operation data of each type of SQL statement;

[0078] An analysis module 606 is used to analyze a first parameter set to be optimized from all parameter sets in the initial database according to the first data set;

[0079] A first optimization module 608, used for inputting all comprehensive evaluation index values ​​and the first parameter set into the prediction model, so that the prediction model performs a primary optimization on the first parameter set according to all comprehensive evaluation index values ​​to obtain a second parameter set after the primary optimization;

[0080] The second optimization module 610 is used to perform multiple iterations of optimization on the second parameter set using the initial database and the prediction model to obtain the optimal parameter set of the initial database.

[0081] It should be noted that the execution module 602 in this embodiment can be used to execute step S102 in the embodiment of the present application, the calculation module 604 in this embodiment can be used to execute step S104 in the embodiment of the present application, the analysis module 606 in this embodiment can be used to execute step S106 in the embodiment of the present application, the first optimization module 608 in this embodiment can be used to execute step S108 in the embodiment of the present application, and the second optimization module 610 in this embodiment can be used to execute step S110 in the embodiment of the present application.

[0082] As an optional example, the calculation module includes:

[0083] A first acquisition unit is used to acquire an execution plan tree generated by the initial database when executing each SQL statement;

[0084] A classification unit is used to classify all SQL statements according to the fingerprint of the execution plan tree of each SQL statement to obtain multiple categories of SQL statements;

[0085] The first summarizing unit is used to summarize the running data of each SQL statement in the target class SQL statement to obtain the running data of the target class SQL statement, wherein the target class SQL statement is any one type of SQL statement in multiple types of SQL statements.

[0086] As an optional example, the above device further includes:

[0087] The removal module is used to remove all abnormal values ​​in the first data set by an adaptive algorithm before calculating the comprehensive evaluation index value of each type of SQL statement according to the running data of each type of SQL statement to obtain an updated first data set.

[0088] As an optional example, the calculation module includes:

[0089] The processing unit is used to take each type of SQL statement as a current type of SQL statement and perform the following steps on the current type of SQL statement:

[0090] Get the performance consumption data and detailed execution time of each execution stage of the current SQL statement, and convert them into comparable units;

[0091] Assign weight factors to the performance consumption data and detailed execution time of each execution stage of the current SQL statement;

[0092] Multiply the performance consumption data and detailed execution time of each execution stage of the current SQL statement by the corresponding weight factor to obtain the weighted result of each execution stage of the current SQL statement;

[0093] The weighted results of each execution phase of the current SQL statement are summed to obtain the comprehensive evaluation index value of the current SQL statement.

[0094] As an optional example, the analysis module includes:

[0095] A first determining unit, configured to determine a bottleneck stage according to a first data set;

[0096] A screening unit, used for screening out a third parameter set related to the bottleneck stage from the full parameter set;

[0097] A second determining unit, used to determine an optimization range of each parameter in a third parameter set;

[0098] The second summarizing unit is used to summarize the third parameter set and the optimization range of each parameter thereof to obtain the first parameter set.

[0099] As an optional example, the second optimization module includes:

[0100] A second acquisition unit is used to acquire a second parameter set and a database used for the M-th optimization, wherein M is a positive integer greater than 1. When M is 2, the second parameter set used for the M-th optimization is the second parameter set after the initial optimization, and the database used for the M-th optimization is the initial database. When M is greater than 2, the second parameter set used for the M-th optimization is the second parameter set after the M-1-th optimization, and the database used for the M-th optimization is the database after the M-1-th optimization.

[0101] A first optimization unit is used to optimize the database used in the M-th optimization according to the second parameter set used in the M-th optimization to obtain the M-th optimized database;

[0102] A calculation unit, used to recalculate the comprehensive evaluation index value of each type of SQL statement based on the SQL statement set and the database after the M-th optimization, to obtain the comprehensive evaluation index value of each type of SQL statement after the M-th optimization;

[0103] The second optimization unit is used to input all the comprehensive evaluation index values ​​after the Mth optimization and the second parameter set used in the Mth optimization into the prediction model, so that the prediction model optimizes the second parameter set used in the Mth optimization according to all the comprehensive evaluation index values ​​after the Mth optimization, obtains the second parameter set after the Mth optimization, updates M=M+1, and performs the M+1th optimization until M is equal to the target threshold to obtain the optimal parameter set.

[0104] As an optional example, the computing unit includes:

[0105] An execution subunit is used to input each SQL statement in the SQL statement set into the database after the M-th optimization, so that the database after the M-th optimization executes each SQL statement and outputs the running data of each SQL statement to obtain a first data set after the M-th optimization;

[0106] The calculation subunit is used to classify and summarize the first data set after the M-th optimization to obtain the running data of each type of SQL statement, and calculate the comprehensive evaluation index value of each type of SQL statement after the M-th optimization based on the running data of each type of SQL statement.

[0107] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0108] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 7 As shown, it includes a processor 702, a communication interface 704, a memory 706 and a communication bus 708, wherein the processor 702, the communication interface 704 and the memory 706 communicate with each other through the communication bus 708, wherein,

[0109] Memory 706, used to store computer programs;

[0110] The processor 702 is used to implement the following steps when executing the computer program stored in the memory 706:

[0111] Input each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement, and outputs the running data of each SQL statement to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the running data includes the initial database executing the SQL statement, the performance consumption data of the server of each node of the initial database, and the detailed execution time of the SQL statement at each node;

[0112] Classify and summarize the first data set to obtain the running data of each type of SQL statement, and calculate the comprehensive evaluation index value of each type of SQL statement according to the running data of each type of SQL statement;

[0113] According to the first data set, a first parameter set to be optimized is analyzed from the full parameter set of the initial database;

[0114] Inputting all comprehensive evaluation index values ​​and the first parameter set into the prediction model, so that the prediction model performs a primary optimization on the first parameter set according to all comprehensive evaluation index values ​​to obtain a second parameter set after the primary optimization;

[0115] The second parameter set is optimized multiple times by using the initial database and the prediction model to obtain the optimal parameter set of the initial database.

[0116] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The communication interface is used for communication between the above electronic device and other devices.

[0117] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0118] As an example, the memory 706 may include, but is not limited to, the execution module 602, the calculation module 604, the analysis module 606, the first optimization module 608, and the second optimization module 610 in the above-mentioned database performance parameter optimization device. In addition, it may also include, but is not limited to, other module units in the above-mentioned database performance parameter optimization device, which will not be repeated in this example.

[0119] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0120] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0121] It can be understood by those skilled in the art that Figure 7The structure shown is for illustration only. The device for implementing the above-mentioned database performance parameter optimization method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 7 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 7 Different configurations shown.

[0122] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0123] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned method for optimizing database performance parameters when executed by a processor.

[0124] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0125] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0126] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0127] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0128] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0131] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for optimizing database performance parameters, characterized in that: include: Input each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement, and outputs the running data of each SQL statement, to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the running data includes the initial database executing the SQL statement, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statement at each node; Classifying and summarizing the first data set to obtain operation data of each type of SQL statement, and calculating a comprehensive evaluation index value of each type of SQL statement based on the operation data of each type of SQL statement; Analyzing, according to the first data set, a first parameter set to be optimized from all parameter sets in the initial database; Inputting all the comprehensive evaluation index values ​​and the first parameter set into a prediction model, so that the prediction model performs a primary optimization on the first parameter set according to all the comprehensive evaluation index values ​​to obtain a second parameter set after the primary optimization; The second parameter set is optimized multiple times by using the initial database and the prediction model to obtain an optimal parameter set of the initial database.

2. The method according to claim 1, characterized in that The first data set is classified and summarized to obtain the operation data of each type of SQL statement, including: Obtaining an execution plan tree generated by the initial database when executing each of the SQL statements; Classifying all the SQL statements according to the fingerprint of the execution plan tree of each of the SQL statements to obtain multiple categories of SQL statements; The running data of each of the target class SQL statements is aggregated to obtain the running data of the target class SQL statements, wherein the target class SQL statements are any one class of SQL statements among multiple classes of SQL statements.

3. The method according to claim 1, characterized in that Before calculating the comprehensive evaluation index value of each type of SQL statement according to the running data of each type of SQL statement, the method further includes: All outliers in the first data set are removed by an adaptive algorithm to obtain an updated first data set.

4. The method according to claim 1, characterized in that The comprehensive evaluation index value of each type of SQL statement calculated based on the running data of each type of SQL statement includes: Take each type of SQL statement as the current type of SQL statement, and perform the following steps on the current type of SQL statement: Obtaining performance consumption data and detailed execution time of each execution phase of the current SQL statement, and converting them into comparable units; Assigning weight factors to the performance consumption data and detailed execution time of each execution stage of the current class SQL statement; Multiply the performance consumption data and detailed execution time of each execution stage of the current SQL statement by the corresponding weight factor to obtain the weighted result of each execution stage of the current SQL statement; The weighted results of each execution phase of the current SQL statement are summed to obtain a comprehensive evaluation index value of the current SQL statement.

5. The method according to claim 1, characterized in that The step of analyzing, according to the first data set, a first parameter set to be optimized from the full parameter set of the initial database comprises: According to the first data set, determining the bottleneck stage; Filtering out a third parameter set related to the bottleneck stage from the full parameter set; determining an optimization range for each parameter in the third parameter set; The third parameter set and the optimization range of each parameter thereof are summarized to obtain the first parameter set.

6. The method according to claim 1, characterized in that The step of performing multiple iterations of optimization on the second parameter set using the initial database and the prediction model to obtain an optimal parameter set for the initial database includes: Obtaining a second parameter set and a database used for the Mth optimization, wherein M is a positive integer greater than 1, when M is 2, the second parameter set used for the Mth optimization is the second parameter set after the initial optimization, and the database used for the Mth optimization is the initial database, and when M is greater than 2, the second parameter set used for the Mth optimization is the second parameter set after the M-1th optimization, and the database used for the Mth optimization is the database after the M-1th optimization; Optimizing the database used in the M-th optimization according to the second parameter set used in the M-th optimization to obtain the M-th optimized database; Recalculate the comprehensive evaluation index value of each type of SQL statement based on the SQL statement set and the database after the M-th optimization to obtain the comprehensive evaluation index value of each type of SQL statement after the M-th optimization; All the comprehensive evaluation index values ​​after the M-th optimization and the second parameter set used in the M-th optimization are input into the prediction model, so that the prediction model optimizes the second parameter set used in the M-th optimization according to all the comprehensive evaluation index values ​​after the M-th optimization, obtains the second parameter set after the M-th optimization, updates M=M+1, and performs the M+1-th optimization until M is equal to the target threshold, thereby obtaining the optimal parameter set.

7. The method according to claim 6, characterized in that The recalculating the comprehensive evaluation index value of each type of SQL statement based on the SQL statement set and the database after the M-th optimization to obtain the comprehensive evaluation index value of each type of SQL statement after the M-th optimization includes: Input each SQL statement in the SQL statement set into the database optimized for the Mth time, so that the database optimized for the Mth time executes each SQL statement and outputs the running data of each SQL statement, to obtain a first data set optimized for the Mth time; The first data set after the M-th optimization is classified and summarized to obtain the running data of each type of SQL statement, and the comprehensive evaluation index value of each type of SQL statement after the M-th optimization is calculated based on the running data of each type of SQL statement.

8. A device for optimizing database performance parameters, characterized in that: include: An execution module, used for inputting each SQL statement in the SQL statement set into the initial database, so that the initial database executes each SQL statement, and outputting the operation data of each SQL statement to obtain a first data set, wherein the SQL statement set includes multiple types of SQL statements, and the operation data includes the initial database executing the SQL statement, the performance consumption data of the server of each node of the initial database and the detailed execution time of the SQL statement at each node; A calculation module, used to classify and summarize the first data set to obtain the operation data of each type of SQL statement, and calculate the comprehensive evaluation index value of each type of SQL statement according to the operation data of each type of SQL statement; An analysis module, configured to analyze, based on the first data set, a first parameter set to be optimized from the full parameter set of the initial database; A first optimization module, used for inputting all the comprehensive evaluation index values ​​and the first parameter set into a prediction model, so that the prediction model performs a primary optimization on the first parameter set according to all the comprehensive evaluation index values ​​to obtain a second parameter set after the primary optimization; The second optimization module is used to perform multiple iterative optimization on the second parameter set using the initial database and the prediction model to obtain the optimal parameter set of the initial database.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Parameter configuration method and device

    CN114756607A

  • SQL (Structured Query Language) performance optimization method based on distributed database

    CN117971889A

  • Method for measuring correlation between database query statement and server energy consumption

    CN118260087A

  • Database performance determination method and device, electronic equipment and storage medium

    CN118733626A

  • Distributed hyperparameter tuning system for machine learning

    US20180240041A1

Cited By

  • Method and apparatus for optimizing performance parameters of database, and electronic device

    WO2026119203A1