Database knob performance evaluation model modeling method and evaluation method

Through automatic machine learning and rule generation models, it solves the problems of high training costs and difficult impact quantification in database knob evaluation, realizes automated and efficient evaluation of database knob performance evaluation, and provides quantitative knob impact assessment and tuning suggestions.

CN118747145APending Publication Date: 2024-10-08HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410885065.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing database knob evaluation methods rely on a large amount of time and computing resources for model training, are unable to accurately quantify the impact of each knob on database performance, and lack interpretability and transferability.

Method used

Using automatic machine learning methods, we select key knobs through two-stage data collection, build a rule generation model, generate rule sets and map configuration combinations to database throughput, realize the modeling of database knob performance evaluation models, and use history in different business scenarios. Experience pool for evaluation.

Benefits of technology

It achieves automation and interpretability of database knob performance evaluation, reduces data collection and training time, improves model efficiency and transferability, and provides quantitative knob impact assessment and tuning suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747145A_ABST
    Figure CN118747145A_ABST
Patent Text Reader

Abstract

The invention discloses a database knob performance evaluation model modeling method and an evaluation method, and relates to the field of database knob evaluation. The problems that a lot of time and computing resources are needed to train the database knob evaluation model and the influence of each knob on the database performance is not quantified in the prior art are solved. According to data collection, the knobs are subjected to importance sorting in two stages, and the key knobs are used for further collecting data in a small range. Database knob related rules are generated based on a rule generation model of automatic machine learning. Then rule fitting is carried out, mapping from rules to database system performance is formed, a database knob performance evaluation model is trained, and knob performance evaluation is carried out through the trained database knob performance evaluation model. The method is mainly used for evaluating the database knob performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of database systems, and in particular to the field of database knob evaluation. Background Art

[0002] Establishing the best knob configuration for a database system can improve the overall performance of the database system. Usually, the industry adjusts the knobs of a database system based on the experience of the database administrator (DBA). However, nowadays, database systems usually have hundreds of knobs. At the same time, the workload in the system is complex and changeable, and the data distribution is constantly changing. It is very difficult to choose the best knobs for the database system based on manual experience, and it also consumes a lot of manpower costs. In order to help DBAs perform knob tuning and enable people to intuitively discover the performance changes brought about by different database system knob configurations, people have defined the knob evaluation problem and conducted relevant research.

[0003] The main difficulty of knob evaluation technology is that the knob configuration of the database system is complex and changeable. In addition to the hundreds of types of knobs, there are at most hundreds of thousands of adjustable values ​​in the knobs. Faced with such a complex solution space, solving the problem of knob evaluation becomes very complicated. How to establish a mapping from the huge knob space to the performance of the database system is a major difficulty. In addition, there are many factors that affect the knob evaluation problem. In addition to the knob value, it is also related to the difference in database systems, operating system parameter settings, and hardware levels.

[0004] In order to solve the knob evaluation problem, people have tried various solutions. Specifically, there are two ways, such as using heuristic methods to set the knob value in different ranges, and using mathematical methods to discover the rules and define its impact. Or through machine learning and deep learning methods, the mapping of database knob configuration to performance is learned into a model, but this requires a lot of time and computing resources for training, consumes a lot of time and computing costs, and the accuracy and transferability cannot be guaranteed. The knob evaluation problem cannot be solved well. Specifically:

[0005] First, the knob evaluation problem is solved by using the random forest-based knob sorting technology: The goal of this technology is to determine which knobs have the greatest impact on performance, that is, to find out which knobs have a strong correlation with the target indicators (such as throughput, average latency). Because the target indicator is continuous, this technology uses a regression model to solve this problem. The regression model estimates the value of the dependent variable Y given a set of independent variables X. In the database knob evaluation problem, the independent variable X represents the value of the database knob configuration, and Y is the performance indicator of the database system we specify. At the same time, in order to measure the impact of each knob, the regression model uses a random forest model, using a variance-based metric to select the knobs included in each tree node. The random forest model is more resistant to noise and overfitting than other models. Figure 1 This is a technical flowchart based on random forest. Figure 1 In the random forest-based technical solution shown, a knob configuration data set is first generated from the current pre-selected knob configuration according to a data generation algorithm; the knob configuration data set is tested in a database system to obtain training data, and the random forest model is trained using the training data; the model regression prediction results and knob importance are obtained.

[0006] Disadvantages of random forest-based knob sorting technology:

[0007] This technical solution can effectively realize the performance prediction of knob configuration, but there are still some shortcomings: first, when the configuration space of the generated knob is relatively large, the algorithm performance is not good enough, and it is necessary to manually pre-screen a small number of knob configurations to generate the knob configuration space, which still requires a lot of manpower and material resources, and also relies a little on human experience; secondly, this method cannot intuitively present the impact of each knob on the performance of the database system. There is only an abstract importance impact in the random forest, and it is impossible to accurately see whether the effect of the knob on the performance is positive or negative, and it is impossible to predict whether it is a linear impact or other types of impact.

[0008] Second, neural network-based fitting technology solves the knob evaluation problem: The goal of this technology is to extract SQL features and knob features, pass them into the neural network as input, and train the neural network to fit these features to the database performance to achieve the purpose of evaluation. Figure 2 It is a flowchart of the technical solution based on neural network; Figure 2 The process of the random forest-based technical solution shown is: initialize the Q table; select the action of the next stage according to the Q table; execute the current action; calculate the reward under the action; update the Q table; determine whether the iteration stop condition is reached, if not, continue to select actions to update the Q table.

[0009] Disadvantages of neural network-based fitting technology:

[0010] This technical solution uses reinforcement learning to solve the knob evaluation recommendation problem, which is more intelligent. However, this method requires a large amount of data for training, which consumes a lot of time and computing costs. The training cost is high for the knob evaluation problem. At the same time, the trained reinforcement learning model is a black box model. We cannot know the reasons for its selection, and the model lacks interpretability.

[0011] Combined with the existing knob evaluation method, the main problems are:

[0012] (1) In previous studies, the knob evaluation task required an experienced DBA to perform a more efficient pre-screening, which resulted in the knob evaluation algorithm still being highly dependent on human experience and not intelligent enough;

[0013] (2) There are many factors that affect knob evaluation, and it is easy to ignore environmental factors, resulting in inaccurate knob evaluation.

[0014] (3) Knob evaluations are mostly estimates of the overall performance of the database system, but there is no quantitative estimate of the impact of each knob on database performance. DBAs lack more information to tune the database system.

[0015] (4) The existing deep learning knob evaluation model requires a large amount of training data, which consumes a lot of time and computing costs, and its accuracy and transferability cannot be guaranteed. Summary of the invention

[0016] The purpose of the present invention is to solve the problem that the existing training of the database knob evaluation model requires a lot of time and computing resources, and the impact of each knob on the database performance is not quantified. The present invention provides a database knob performance evaluation model modeling method and evaluation method.

[0017] A database knob performance evaluation model modeling method, the modeling method comprises the following steps:

[0018] S1. Data collection in the same business scenario:

[0019] In the first stage, N key knobs are selected;

[0020] In the second stage, the N selected key knobs form a final configuration combination, and the configuration data corresponding to various key knobs in each final configuration combination under the same business scenario and the database throughput corresponding to each final configuration combination are collected;

[0021] S2. Using the configuration data in each final configuration combination as input and the database throughput corresponding to the final configuration combination as output, training a rule generation model based on automatic machine learning;

[0022] S3, extracting the rules of the trained rule generation model to obtain a rule set;

[0023] S4. Configure the combined mapping as an array:

[0024] Determine whether the configuration data in each final configuration combination meets each rule in the rule set, and generate an array of length L; the array is composed of 0 and 1, and the length of the array is the same as the number of rules in the rule set;

[0025] The judgment condition is that when the configuration data in the final selected configuration combination does not meet the rules, it is marked as 0, and when the configuration data in the final selected configuration combination meets the rules, it is marked as 1;

[0026] S5. The array corresponding to each final configuration combination is used as input, and the database throughput corresponding to the final configuration combination is used as output, and the database knob performance evaluation model is trained to complete the modeling of the database knob performance evaluation model.

[0027] Preferably, the implementation of step S1, screening out N key knobs, includes:

[0028] S11, collecting configuration data corresponding to each knob in each preliminary configuration combination under the same business scenario, and database throughput corresponding to each preliminary configuration combination; the preliminary configuration combination includes M knobs, the categories of the M knobs are different, and N<M;

[0029] S12, taking the configuration data in each preliminary configuration combination as input, and taking the database throughput corresponding to the preliminary configuration combination as output, to form an original data set;

[0030] Four knob importance verification models were trained using the original dataset;

[0031] S13, calculate the standard errors of the four trained knob importance validation models;

[0032] S14, shuffling the configuration data corresponding to the knobs in any category in the original data set to form a corresponding new data set, and the knobs in M ​​categories form M new data sets in total; the configuration data in each preliminary configuration combination in the new data set is used as input, and the database throughput corresponding to the preliminary configuration combination is used as output;

[0033] S15, using M new data sets, determining the knob importance rankings corresponding to various trained knob importance verification models;

[0034] S16. Sort the knob importances corresponding to the four trained knob importance verification models, take a weighted average of the serial numbers of all knobs of the same category, sort the obtained weighted averages of the knobs of each category from small to large, and take the N knobs corresponding to the first N weighted averages as the key knobs.

[0035] Preferably, S13, calculating the standard errors of the four trained knob importance verification models is implemented as follows:

[0036] The four trained knob importance verification models all predict the knob performance of the configuration data of the preliminary configuration combination in the original data set, and the four trained knob importance verification models all predict the database throughput corresponding to each preliminary configuration combination;

[0037] The difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models is calculated, and all the differences corresponding to the trained knob importance verification model are weighted averaged to obtain the standard error of the trained knob importance verification model.

[0038] Preferably, S15, using M new data sets to determine the knob importance rankings corresponding to various trained knob importance verification models, includes:

[0039] S151, determining M actual errors corresponding to various trained knob importance verification models under M new data sets, and determining M error changes corresponding to various trained knob importance verification models under M new data sets respectively in combination with standard errors; each new data set has a one-to-one correspondence with the actual error and the error change;

[0040] S152, sorting the values ​​of the M error changes corresponding to the various trained knob importance verification models from large to small, thereby determining the sorting of the M error changes;

[0041] The ranking of the M error changes Δi is the same as the importance ranking of the M categories of knobs to which they correspond, wherein the larger the error change, the smaller the importance number of the corresponding knob.

[0042] Preferably, the implementation method of step S151, determining M actual errors corresponding to various trained knob importance verification models under M new data sets, includes:

[0043] Using various trained knob importance verification models, the knob performance is predicted for the configuration data of the preliminary configuration combinations in M ​​new data sets. Under each new data set, various trained knob importance verification models predict the database throughput corresponding to each preliminary configuration combination.

[0044] The difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models under each new data set is calculated, and all the differences are weighted averaged to obtain the actual error of the trained knob importance verification model under each new data set.

[0045] Preferably, the four knob importance verification models are respectively a multi-layer perceptron model, a Gaussian process regression model, a lasso regression model and a gradient boosting tree model.

[0046] The knob performance evaluation method under the same business scenario implemented by the database knob performance evaluation model modeling method, the business scenario corresponding to the trained database knob performance evaluation model is the same as the business scenario corresponding to the configuration combination to be tested; the knob performance evaluation method under the same business scenario includes:

[0047] The configuration combination to be tested is mapped into an array, and the array is used as the input of the trained database knob performance evaluation model to perform performance prediction, output the database throughput corresponding to the configuration combination to be tested, and complete the evaluation.

[0048] The knob performance evaluation method under different business scenarios is implemented by adopting the database knob performance evaluation model modeling method. The knob performance evaluation method under different business scenarios relies on the historical experience pool to be implemented. The historical experience pool stores multiple business scenarios, the trained database knob performance evaluation model corresponding to each business scenario, and the load characteristics corresponding to each business scenario;

[0049] The knob performance evaluation methods in different business scenarios include:

[0050] First, the current load characteristics are similarly matched with the load characteristics in the historical experience pool to obtain the database knob performance evaluation models of all successfully matched trainings;

[0051] Secondly, the configuration combination to be tested corresponding to the current load characteristics is mapped into an array, and the array is used as the input of all successfully matched trained database knob performance evaluation models to perform performance prediction. Each successfully matched trained database knob performance evaluation model predicts the database throughput, and all predicted database throughputs are weighted averaged. The obtained result is used as the evaluation result to complete the evaluation.

[0052] Preferably, the implementation method of obtaining all database knob performance evaluation models after training that are successfully matched includes:

[0053] The Euclidean distances between the current load characteristics and the load characteristics in the historical experience pool are calculated respectively, and when the calculated Euclidean distance is greater than the preset distance, the trained database knob performance evaluation model corresponding to the load characteristics in the historical experience pool is used as the successfully matched trained database knob performance evaluation model.

[0054] Preferably, the number of all trained database knob performance evaluation models that are successfully matched is 1 or more.

[0055] The beneficial effects brought by the present invention are:

[0056] The present invention utilizes automatic machine learning to extract interpretable relevant information between knobs and performance, and can automatically provide the DBA with the changing relationship between performance and knobs. This can be used as a rule reserve for the DBA to guide the DBA's knob tuning range. The automatic machine learning process does not require manual setting of hyperparameters and is adaptive.

[0057] The present invention can fit the satisfaction of the relationship (i.e., the rule) and the database performance index to obtain a complex mapping relationship, and learn the dependency relationship between the knobs, which can enable the DBA to jump out of the local optimal solution of database tuning, thereby helping it to improve the overall performance of the database.

[0058] In the data collection stage of the present invention, two stages of data collection are carried out. In the first stage, N key knobs are screened out. In the second stage, the configuration data and database throughput corresponding to the final configuration combination composed of the key knobs are collected using the screened out N key knobs. The present invention uses a knob pre-selection method to support pre-selection of a part of the key knobs from a larger knob set for evaluation. A small number of key knobs of the database system have a great impact on the system performance. Therefore, sensitive knobs of the current load can be recommended to the DBA, thereby reducing the scope and time of DBA knob tuning.

[0059] The present invention adopts a two-stage data collection technology. First, a small amount of data is collected to screen important knobs, also known as key knobs. Then, based on a small amount of knobs, large-scale data collection is carried out by sampling. This saves data collection time and can effectively improve the efficiency of data utilization. Sampling is carried out on a load-sensitive set of knobs to reduce the scale of data collection, save training time, improve modeling efficiency, quantify the impact of knobs on database performance, and use key knobs for performance evaluation.

[0060] The present invention also provides a knob performance evaluation method for the same task scenario and different task scenarios, and a knob performance evaluation method for different business scenarios. The present invention can accumulate and reuse historical experience data, can obtain historical matching experience based on the load characteristic query of the database, and weightedly reuse knob tuning rules, can skip the time-consuming part of data collection, and quickly provide knob tuning suggestions to the DBA, making the system more portable. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a structural diagram of the flow chart of the technical solution to the knob evaluation problem based on random forest;

[0062] Figure 2 It is a flow chart of the technical solution to the knob evaluation problem based on neural network;

[0063] Figure 3 It is a schematic diagram of the principle of two-stage data collection;

[0064] Figure 4 It is a schematic diagram of the principle of the database knob performance evaluation model modeling method;

[0065] Figure 5 It is a schematic diagram of the principle of the knob performance evaluation method. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0068] The present invention provides the solutions described in the specific implementation modes 1 to 3, which solve the existing problems that a lot of time and computing resources are needed to train the database knob evaluation model, and the impact of each knob on the database performance is not quantified. The present invention can realize the database knob evaluation function, and the input is the configuration value of the database knob. Since the knob evaluation is based on rules, the value does not need to be normalized, and the output is the performance evaluation of the knob configuration, that is, the database throughput. The database knob performance evaluation model is trained through input and output, and the database knob performance evaluation model after training can be used to predict the performance impact of each knob in the database system on the database system. The core of the present invention is rule generation and rule fitting. The rules are generated through training data, and rule fitting is to construct a mapping between the hyperspace divided by the rules and the database performance.

[0069] Implementation method 1, see Figure 3 and Figure 4 , a database knob performance evaluation model modeling method, the modeling method includes the following steps:

[0070] S1. See Figure 3 ,For data collection in the same business scenario, we first sample and modify most of the knobs in the database, then sort the knobs by importance, and use the knobs that have a greater impact on database performance as candidate sets for knob evaluation, and further collect data in a small range. Specifically:

[0071] In the first stage, N key knobs are selected;

[0072] In the second stage, the N selected key knobs form a final configuration combination, and the configuration data corresponding to various key knobs in each final configuration combination under the same business scenario and the database throughput corresponding to each final configuration combination are collected;

[0073] In the first stage, N key knobs are screened out, including:

[0074] S11, collecting configuration data corresponding to each knob in each preliminary configuration combination under the same business scenario, and database throughput corresponding to each preliminary configuration combination; the preliminary configuration combination includes M knobs, the categories of the M knobs are different, and N<M;

[0075] S12, taking the configuration data in each preliminary configuration combination as input, and taking the database throughput corresponding to the preliminary configuration combination as output, to form an original data set;

[0076] Four knob importance verification models are trained using the original data set; as examples, the four knob importance verification models are multi-layer perceptron model, Gaussian process regression model, lasso regression model and gradient boosting tree model respectively;

[0077] S13, calculating the standard errors of the four trained knob importance verification models; specifically: the four trained knob importance verification models all predict the knob performance of the configuration data of the preliminary configuration combination in the original data set, and the four trained knob importance verification models all predict the database throughput corresponding to each preliminary configuration combination;

[0078] The difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models is calculated, and all the differences corresponding to the trained knob importance verification model are weighted averaged to obtain the standard error of the trained knob importance verification model.

[0079] S14, shuffling the configuration data corresponding to the knobs in any category in the original data set to form a corresponding new data set, and the knobs in M ​​categories form M new data sets in total; the configuration data in each preliminary configuration combination in the new data set is used as input, and the database throughput corresponding to the preliminary configuration combination is used as output;

[0080] S15. Using M new data sets, determine the knob importance rankings corresponding to various trained knob importance verification models; specifically:

[0081] S151, determining M actual errors corresponding to various trained knob importance verification models under M new data sets, and determining M error changes corresponding to various trained knob importance verification models under M new data sets respectively in combination with standard errors; each new data set has a one-to-one correspondence with the actual error and the error change;

[0082] Among them, the implementation method of determining M actual errors corresponding to various trained knob importance verification models under M new data sets includes:

[0083] Using various trained knob importance verification models, the knob performance is predicted for the configuration data of the preliminary configuration combinations in M ​​new data sets. Under each new data set, various trained knob importance verification models predict the database throughput corresponding to each preliminary configuration combination.

[0084] Calculate the difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models under each new data set, and perform weighted average on all the differences to obtain the actual error of the trained knob importance verification model under each new data set;

[0085] S152, sorting the values ​​of the M error changes corresponding to the various trained knob importance verification models from large to small, thereby determining the sorting of the M error changes;

[0086] The ranking of the M error changes Δi is the same as the importance ranking of the M categories of knobs to which they correspond, wherein the larger the error change, the smaller the importance number of the corresponding knob.

[0087] S16, according to the knob importance ranking corresponding to the four trained knob importance verification models, weighted average the serial numbers of all knobs of the same category, sort the obtained weighted average values ​​of the knobs of each category from small to large, and take the N knobs corresponding to the first N weighted average values ​​as key knobs;

[0088] S2. Using the configuration data in each final configuration combination as input and the database throughput corresponding to the final configuration combination as output, training a rule generation model based on automatic machine learning;

[0089] S3. Extract the rules of the trained rule generation model to obtain a rule set. The rule generation model is implemented using random forest, which can be understood as a set of decision trees. The predicted value is output according to the satisfied relationship of the knob. In general applications, random forest is used as a black box, that is, it only cares about whether the output result is accurate after the input configuration. As an interpretable model, the judgment logic inside the decision tree is extracted to obtain the rules. Given the configuration of the knob, it can be mapped by the rule set it satisfies.

[0090] S4. Configure the combined mapping as an array:

[0091] Determine whether the configuration data in each final configuration combination meets each rule in the rule set, and generate an array of length L; the array is composed of 0 and 1, and the length of the array is the same as the number of rules in the rule set;

[0092] The judgment condition is that when the configuration data in the final selected configuration combination does not meet the rules, it is marked as 0, and when the configuration data in the final selected configuration combination meets the rules, it is marked as 1;

[0093] As an example: if the number of rules in the rule set is 2, the rule set: {Rule 1: workmem>10andenable_nested_loop=off, Rule 2: workmem<500,and shared_buffers>1000}, when the given configuration is:

[0094] {workmem=100,enable_nested_loop=on,shared_buffers=2000}, it can be found that it does not meet the first rule, but meets the second rule, so the obtained 01 array is: [0,1], 0 represents that the rule is not met, and 1 represents that the rule is met;

[0095] S5. The array corresponding to each final configuration combination is used as input, and the database throughput corresponding to the final configuration combination is used as output, and the database knob performance evaluation model is trained to complete the modeling of the database knob performance evaluation model.

[0096] Data collection in the database knob performance evaluation model modeling method: Generate the data set required for testing the database system performance. This part is a two-stage data collection: first, sample and modify most of the knobs in the database, then sort the knobs by importance, and use the knobs that have a greater impact on database performance as candidate sets for knob evaluation, and further collect data in a small range. Rule generation module based on automatic machine learning: Generate database knob-related rules based on training data. Rule fitting, form a mapping from rules to database system performance, train the database knob performance evaluation model, complete the training, and then model the time evaluation model.

[0097] Implementation Method 2: See Figure 4 The knob performance evaluation method under the same business scenario is implemented by the database knob performance evaluation model modeling method, and the business scenario corresponding to the trained database knob performance evaluation model is the same as the business scenario corresponding to the configuration combination to be tested; the knob performance evaluation method under the same business scenario includes:

[0098] The configuration combination to be tested is mapped into an array, and the array is used as the input of the trained database knob performance evaluation model to perform performance prediction, output the database throughput corresponding to the configuration combination to be tested, and complete the evaluation.

[0099] Implementation Party 3, see Figure 5 , a knob performance evaluation method for different business scenarios implemented by the database knob performance evaluation model modeling method, the knob performance evaluation method for different business scenarios relies on a historical experience pool, and the historical experience pool stores multiple business scenarios, the trained database knob performance evaluation model corresponding to each business scenario, and the load characteristics corresponding to each business scenario;

[0100] The knob performance evaluation methods in different business scenarios include:

[0101] First, the current load feature is similarly matched with each load feature in the historical experience pool to obtain all the trained database knob performance evaluation models that are successfully matched; specifically, the Euclidean distance between the current load feature and each load feature in the historical experience pool is calculated, and when the calculated Euclidean distance is greater than the preset distance, the trained database knob performance evaluation model corresponding to the load feature in the historical experience pool is used as the trained database knob performance evaluation model that is successfully matched;

[0102] Secondly, the configuration combination to be tested corresponding to the current load characteristics is mapped into an array, and the array is used as the input of all successfully matched trained database knob performance evaluation models to perform performance prediction. Each successfully matched trained database knob performance evaluation model predicts the database throughput, and all predicted database throughputs are weighted averaged. The obtained result is used as the evaluation result to complete the evaluation.

[0103] The number of all trained database knob performance evaluation models that are successfully matched is 1 or more.

[0104] In specific applications, historical experience pool: when the user does not want to change the knob to collect data, the current load characteristics can be matched with the load characteristics in the experience pool, and then the historical experience in the experience pool can be reused to achieve rapid rule generation. Specific process: First, read the proportion of the user's historical query types through the log, including the proportion of delete, insert, update, select, and the proportion of operators involved in its query plan, and obtain the load characteristics. The load characteristics are a vector composed of a query plan and the proportion of operators involved in the query plan. For example, the query type ratio [delete: 0.2, update: 0.3, insert: 0.1, select: 0.4] and operator ratio [seq_scan: 0.5, hash_join: 0.2, group: 0.3], the final load characteristics are [0.2, 0.3, 0.1, 0.4, 0.5, 0.2, 0.3]. According to this load characteristic, the similar experience in the experience pool is matched, and then the trained database knob performance evaluation model corresponding to the experience is read (there will be multiple similar experiences, and the user can configure how many historical experiences to select for reuse). The predicted values ​​are weighted averaged to get the prediction result.

[0105] Although the present invention is described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. It should therefore be understood that many modifications may be made to the exemplary embodiments and that other arrangements may be devised without departing from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in a manner different from that described in the original claims. It should also be understood that features described in conjunction with individual embodiments may be used in other described embodiments.

Claims

1. A database knob performance evaluation model modeling method, characterized in that: The modeling method includes the following steps: S1. Data collection in the same business scenario: In the first stage, N key knobs are selected; In the second stage, the N selected key knobs form a final configuration combination, and the configuration data corresponding to various key knobs in each final configuration combination under the same business scenario and the database throughput corresponding to each final configuration combination are collected; S2. Using the configuration data in each final configuration combination as input and the database throughput corresponding to the final configuration combination as output, training a rule generation model based on automatic machine learning; S3, extracting the rules of the trained rule generation model to obtain a rule set; S4. Configure the combined mapping as an array: Determine whether the configuration data in each final configuration combination meets each rule in the rule set, and generate an array of length L; the array is composed of 0 and 1, and the length of the array is the same as the number of rules in the rule set; The judgment condition is that when the configuration data in the final selected configuration combination does not meet the rules, it is marked as 0, and when the configuration data in the final selected configuration combination meets the rules, it is marked as 1; S5. The array corresponding to each final configuration combination is used as input, and the database throughput corresponding to the final configuration combination is used as output, and the database knob performance evaluation model is trained to complete the modeling of the database knob performance evaluation model.

2. The database knob performance evaluation model modeling method according to claim 1 is characterized in that: Step S1, the implementation method of selecting N key knobs includes: S11, collecting configuration data corresponding to each knob in each preliminary configuration combination under the same business scenario, and database throughput corresponding to each preliminary configuration combination; the preliminary configuration combination includes M knobs, the categories of the M knobs are different, and N<M; S12, taking the configuration data in each preliminary configuration combination as input, and taking the database throughput corresponding to the preliminary configuration combination as output, to form an original data set; Four knob importance verification models were trained using the original dataset; S13, calculate the standard errors of the four trained knob importance validation models; S14, shuffling the configuration data corresponding to the knobs in any category in the original data set to form a corresponding new data set, and the knobs in M ​​categories form M new data sets in total; the configuration data in each preliminary configuration combination in the new data set is used as input, and the database throughput corresponding to the preliminary configuration combination is used as output; S15, using M new data sets, determining the knob importance rankings corresponding to various trained knob importance verification models; S16. Sort the knob importances corresponding to the four trained knob importance verification models, take a weighted average of the serial numbers of all knobs of the same category, sort the obtained weighted averages of the knobs of each category from small to large, and take the N knobs corresponding to the first N weighted averages as the key knobs.

3. The database knob performance evaluation model modeling method according to claim 2 is characterized in that: S13. Calculate the standard error of the four trained knob importance validation models: The four trained knob importance verification models all predict the knob performance of the configuration data of the preliminary configuration combination in the original data set, and the four trained knob importance verification models all predict the database throughput corresponding to each preliminary configuration combination; The difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models is calculated, and all the differences corresponding to the trained knob importance verification model are weighted averaged to obtain the standard error of the trained knob importance verification model.

4. The database knob performance evaluation model modeling method according to claim 2, characterized in that: S15. The implementation method of using M new data sets to determine the knob importance rankings corresponding to various trained knob importance verification models includes: S151, determining M actual errors corresponding to various trained knob importance verification models under M new data sets, and determining M error changes corresponding to various trained knob importance verification models under M new data sets respectively in combination with standard errors; each new data set has a one-to-one correspondence with the actual error and the error change; S152, sorting the values ​​of the M error changes corresponding to the various trained knob importance verification models from large to small, thereby determining the sorting of the M error changes; The ranking of the M error changes Δi is the same as the importance ranking of the M categories of knobs to which they correspond, wherein the larger the error change, the smaller the importance number of the corresponding knob.

5. The database knob performance evaluation model modeling method according to claim 4, characterized in that: Step S151, determining M actual errors corresponding to various trained knob importance verification models under M new data sets, includes: Using various trained knob importance verification models, the knob performance is predicted for the configuration data of the preliminary configuration combinations in M ​​new data sets. Under each new data set, various trained knob importance verification models predict the database throughput corresponding to each preliminary configuration combination. The difference between the collected database throughput corresponding to each preliminary configuration combination and the corresponding database throughput predicted by various trained knob importance verification models under each new data set is calculated, and all the differences are weighted averaged to obtain the actual error of the trained knob importance verification model under each new data set.

6. The database knob performance evaluation model modeling method according to claim 2, characterized in that: The four knob importance verification models are the multi-layer perceptron model, Gaussian process regression model, lasso regression model and gradient boosting tree model.

7. A knob performance evaluation method in the same business scenario implemented by the database knob performance evaluation model modeling method according to any one of claims 1 to 6, characterized in that: The business scenario corresponding to the trained database knob performance evaluation model is the same as the business scenario corresponding to the configuration combination to be tested; the knob performance evaluation method under the same business scenario includes: The configuration combination to be tested is mapped into an array, and the array is used as the input of the trained database knob performance evaluation model to perform performance prediction, output the database throughput corresponding to the configuration combination to be tested, and complete the evaluation.

8. A knob performance evaluation method for different business scenarios implemented by the database knob performance evaluation model modeling method according to any one of claims 1 to 6, wherein the knob performance evaluation method for different business scenarios relies on a historical experience pool, wherein the historical experience pool stores a variety of business scenarios, a trained database knob performance evaluation model corresponding to each business scenario, and a load characteristic corresponding to each business scenario; characterized in that: The knob performance evaluation methods in different business scenarios include: First, the current load characteristics are similarly matched with the load characteristics in the historical experience pool to obtain the database knob performance evaluation models of all successfully matched trainings; Secondly, the configuration combination to be tested corresponding to the current load characteristics is mapped into an array, and the array is used as the input of all successfully matched trained database knob performance evaluation models to perform performance prediction. Each successfully matched trained database knob performance evaluation model predicts the database throughput, and all predicted database throughputs are weighted averaged. The obtained result is used as the evaluation result to complete the evaluation.

9. The method for evaluating knob performance in different business scenarios using a database knob performance evaluation model modeling method according to claim 8, characterized in that: The implementation method of obtaining all the database knob performance evaluation models that have been successfully matched includes: The Euclidean distances between the current load characteristics and the load characteristics in the historical experience pool are calculated respectively, and when the calculated Euclidean distance is greater than the preset distance, the trained database knob performance evaluation model corresponding to the load characteristics in the historical experience pool is used as the successfully matched trained database knob performance evaluation model.

10. The method for evaluating knob performance in different business scenarios using a database knob performance evaluation model modeling method according to claim 8, characterized in that: The number of all trained database knob performance evaluation models that are successfully matched is 1 or more.