Database system configuration parameter tuning algorithm based on load characterization and large model exploration
The database system configuration parameter tuning algorithm, which utilizes load characterization and large model exploration, leverages Transformer encoders and decoders for workload characterization and combines historical knowledge bases and large model inference to solve the problems of high resource consumption and low efficiency in existing technologies, thus achieving efficient database configuration parameter tuning.
Patent Information
- Application Number
- CN202510911520.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-12-02
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing database system configuration parameter tuning methods suffer from high resource consumption, low efficiency, inability to effectively utilize historical tuning knowledge, and poor adaptability to dynamic changes in workload.
A database system configuration parameter tuning algorithm based on load characterization and large model exploration is adopted. It utilizes a hierarchical Transformer encoder and load reconstruction decoder to characterize the workload, and combines a historical tuning knowledge base and large model inference. Through a cold start mechanism and Latin hypercube sampling, it efficiently explores high-performance configurations in the configuration space.
It improves the efficiency and resource utilization of database system configuration parameter tuning, reduces time and resource consumption, and improves the convergence speed and performance of tuning.
Smart Images

Figure CN121051084A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database system configuration parameter tuning algorithm technology, and in particular to a database system configuration parameter tuning algorithm based on load characterization and large model exploration. Background Technology
[0002] Modern database systems typically offer hundreds of configurable parameters to adapt to different business needs, hardware environments, and workload characteristics. Different combinations of configuration parameters can lead to variations in database system performance. Achieving high-performance database services is crucial for improving enterprise business efficiency and reducing resource consumption. Therefore, research on the optimization of database system configuration parameters has significant application value. However, existing technologies have the following drawbacks:
[0003] First, search-based database system configuration parameter tuning methods do not require building performance prediction models and are directly effective, but the huge configuration space will lead to a high consumption of time and resources. In addition, most methods do not consider the constraints between configuration parameters during the search process, resulting in a large number of configuration samples that violate domain knowledge rules. Moreover, most methods cannot utilize historical tuning knowledge and need to start searching from scratch for new tuning tasks, which is inefficient.
[0004] Second, traditional machine learning-based database system configuration tuning methods predict database system performance by building performance models, thus replacing the actual execution of workloads and significantly reducing the resource overhead caused by repeatedly executing workloads during the exploration process. However, existing methods also have problems such as strong empirical reliance on parameter selection, the need for a large number of high-quality samples to build performance models, and dynamic changes in workloads. Deep reinforcement learning-based database system configuration tuning methods do not require collecting a large number of samples to train performance models, but they suffer from slow convergence speed, with each round of tuning typically requiring hundreds of iterations. Therefore, they are only suitable for scenarios with long tuning times and have weaker versatility than traditional machine learning-based methods.
[0005] Third, the database system configuration parameter optimization method based on natural language processing uses a large language model to extract effective information from domain knowledge, accelerates the convergence of the configuration parameter tuning algorithm, and improves the tuning performance. However, this direction is still in the early exploration stage and still has some shortcomings: (1) Some works require fine-tuning of the model, which will lead to additional resource consumption, whether in the initialization stage or the tuning stage; (2) The domain knowledge is not fully utilized. Most works only extract the default value, suggested value, and range information of the parameters, while paying less attention to the dependency relationship and constraint conditions between parameters. This will sample and explore a large number of configurations that violate the dependency relationship between parameters, resulting in resource waste. (3) The dynamic changes of workload are not considered. The tuning process is restarted for each new workload, and the experience in the historical tuning tasks cannot be effectively utilized, resulting in low efficiency and resource waste. (4) The natural language understanding and reasoning ability of the large model is not fully utilized. Most works are limited to using the large language model to complete the knowledge extraction work, but do not use the large language model for knowledge reasoning. Therefore, we propose a database system configuration parameter tuning algorithm based on load representation and large model exploration. Summary of the Invention
[0006] This application provides a database system configuration parameter tuning algorithm based on load characterization and large model exploration to solve the problems mentioned above.
[0007] This application provides a database system configuration parameter tuning algorithm based on load characterization and large model exploration, including:
[0008] A database workload characterization mechanism, wherein the database workload characterization mechanism transmits a connection to a tuning cold start mechanism, wherein the tuning cold start mechanism transmits a connection to a large model enhancement exploration and utilization strategy mechanism;
[0009] The database workload characterization mechanism includes a hierarchical Transformer encoder and a workload reconstruction decoder with self-supervised training; the tuning cold start mechanism includes initialization of the historical tuning knowledge base, workload characterization and similarity matching, and initialization of the exploration configuration set.
[0010] The database workload representation mechanism consists of a set of SQL statements, which describe the database query, update, and insert operations.
[0011] The optimization cold start mechanism constructs a good configuration set as the starting point for the optimization task of the target workload based on the optimization experience of similar historical workloads, thereby reducing the number of iterations required in the subsequent exploration process and the cost of configuration measurement.
[0012] The large model-enhanced exploration and utilization strategy combines the ideas of exploration and utilization. Based on the initial configuration, it further optimizes the configuration of new workloads. In the exploration phase, Latin hypercube sampling is used to randomly and uniformly sample in the configuration space. In the utilization phase, a large model is introduced to perform knowledge reasoning and generate potential high-performance configurations.
[0013] Preferably, the hierarchical Transformer encoder first encodes each SQL statement in the workload individually based on the statement-level encoder to generate a statement-level semantic vector, and then uses a load-level aggregator to fuse all statement features to generate a global workload representation, specifically including statement-level encoding and load-level aggregation.
[0014] Preferably, the statement-level encoding provides a workload W consisting of N SQL statements, i.e., W = {q1, q2, ..., q...}. n First, input processing is performed, processing each SQL statement q i Decomposed into word sequence t i,1 , t i,2 , ..., t i,m Based on this, special symbols [CLS_i] and [SEP_i] are added for the start and end positions, and then token embedding and position encoding are performed to obtain the SQL statement q. i input vector x i =(x i,1 x i,2 , ..., x i,m ):
[0015] x i,j =Embedding(t) i,j +PositionEncoding(j)
[0016] Where: x i,j This represents the SQL statement q. i input vector x i In a vector, Embedding represents the mapping function, t i,j This represents the QL statement q i Decomposed into a sequence within the word sequence, PositionEncoding represents the position encoding, j represents the SQL statement q i input vector x i The position of a vector in;
[0017] Then, a statement-level encoder is used to process the input vector x. i The encoding process involves a statement-level encoder composed of L stacked Transformer layers. Each statement shares the encoder's weights, and the final output hidden state vector is:
[0018] h i,j =TransformerEncoder(x i )
[0019] Finally, the hidden state vector at position [CLS_i] is used as the feature vector S of the SQL statement. i :
[0020] S i =h
[0021] Where: TransformerEncoder represents the encoder of the Transformer, and h represents the hidden state vector at the last [CLS_i] position.
[0022] Preferably, the load-level aggregation is to aggregate the feature vectors S of N SQL statements. i ={s1, s2, ..., s N The aggregated features are first captured as a global load feature z. A load-level Transformer encoder is then used to capture the dependencies between the feature vectors of the N SQL statements.
[0023] S' = S + PE workload (1,2,...,N)
[0024] {s'1, s'2, ..., s' N = TransformerEncoder(S')
[0025] Among them: PE workload This represents the position encoding function, where S is the feature vector corresponding to N SQL statements;
[0026] Then, average pooling is used to obtain the global load characteristic z:
[0027] z=AveragePooling(s'1,s'2,...,s' N )
[0028] Where: AveragePooling represents the average pooling function.
[0029] Preferably, the load reconstruction decoder and self-supervised training further include the following steps:
[0030] S1. Characterize the workload output vector Z∈R from the encoder. d Expanded to a temporal dimension Z'∈R MXd , serving as the global memory vector for the load reconstruction decoder:
[0031] Z' = repeat(z, M) ∈ R MXd
[0032] Where: M is the length of the target sequence;
[0033] S2. A standard Transformer decoder structure is used, incorporating masked self-attention and cross-attention mechanisms. Masked self-attention models the dependencies within the target sequence. In cross-attention, Z' is used as the key and value, and the outputs at each position of the masked self-attention are used as queries, encoding each position to ensure differences in the key and value at different time steps. The memory vector Z' at time t is... t for:
[0034] Z' t =Z+PE(t)∈R d
[0035] Where: Z represents the workload feature vector output by the encoder, and PE represents the position coding function;
[0036] Generate the j-th word t of the i-th statement sequentially. i,j :
[0037]
[0038] Where: TransformerDecoder represents the decoder of Transformer, and Z' represents the extension vector of the workload feature vector in the temporal dimension;
[0039] S3. Train the designed encoder-decoder model so that the feature vector output by the encoder can accurately characterize the workload. Design different types of learning tasks and reduce the burden of data collection. The encoder-decoder training is driven by a workload reconstruction task. That is, the encoder is input with an SQL sequence containing the workload, and the decoder reconstructs the complete SQL statement sequence autoregressively. The loss function is the sequence cross-entropy loss L. Recon as follows:
[0040]
[0041] Where: P represents a constant, t i,j This represents the j-th word in the i-th statement.
[0042] Preferably, the historical optimization knowledge base initialized in the historical optimization knowledge base stores historical workload feature vectors and their high-performance configurations. When historical data accumulation is lacking, a small number of workloads are generated and several rounds of random searches are performed on each workload. The top-K high-performance configurations are selected and added to the knowledge base to complete the initialization of the knowledge base. During the historical data accumulation process, the top-K high-performance configurations discovered during the overall optimization of each workload are added to the knowledge base.
[0043] Preferably, the workload characterization and similarity matching are performed on the new workload w new The SQL sequence is used to generate feature vectors v using the encoder of the workload2vec model trained by the workload featureization module. new Then, cosine similarity is used to calculate the similarity sim(w) between the new workload and the historical workload. new w his ):
[0044]
[0045] Where: w his Indicates historical workload, v his This indicates that the encoder generates historical feature vectors.
[0046] Preferably, the initial exploration configuration set selects the Top-K (K=3) historical loads with the highest similarity, and uses their corresponding high-performance configurations as the initial exploration configuration set. The configuration parameter tuning process starts from this set containing high-performance configurations of similar workloads.
[0047] The technical solutions provided in this application have the following advantages compared with the prior art:
[0048] The overall structure provided in this application embodiment allows the method to leverage experience and data gained from past tuning tasks, combined with the ideas of exploration and utilization, and the natural language understanding and reasoning capabilities of a large language model, to improve the efficiency of finding optimal configuration parameters for new workloads. First, through NLP representation learning techniques, a hierarchical Transformer encoder and a workload reconstruction decoder are used to transform complex workloads into low-dimensional feature vector representations. Then, a tuning cold start is performed, utilizing the similarity between workload feature representations to match new workloads with similar historical workloads, and using the optimal configurations of similar historical workloads as the initial configuration set, avoiding tuning from scratch and saving time and resources. Next, a large model enhancement exploration and utilization process is conducted. Combining the ideas of exploration and utilization, the configuration of the new workload is further optimized based on the initial configuration. In the exploration phase, a Latin hypercube sampling method is used to uniformly sample in the configuration space, while in the utilization phase, potential high-performance configurations are generated through large model knowledge reasoning. Through these approaches, we can start the tuning process of the target workload from several good initial configuration points and efficiently explore potential configurations in the configuration space, effectively improving the convergence speed of tuning and reducing time and resource consumption. Attached Figure Description
[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram of the overall principle and structure of the present invention;
[0052] Figure 2 The graph shows the optimization results of the various algorithms of this invention for TPC-H and TPC-C under different configuration metric costs. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] Various embodiments of this application may exist in the form of a range. It should be understood that the description in the form of a range is merely for convenience and brevity and should not be construed as a rigid limitation on the scope of this application. Therefore, it should be considered that the range description has specifically disclosed all possible sub-ranges and single numerical values within that range. For example, it should be considered that the range description from 1 to 6 has specifically disclosed sub-ranges, such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., and single numbers within the range, such as 1, 2, 3, 4, 5, and 6, regardless of the range. In addition, whenever a numerical range is indicated in this application, it means including any referenced number (fraction or integer) within the indicated range. Unless otherwise specified, all raw materials, reagents, instruments, and equipment used in this application can be purchased commercially or prepared using existing equipment.
[0055] In this application, unless otherwise stated, directional terms such as "upper" and "lower" specifically refer to the drawing directions in the accompanying drawings. Furthermore, in this application, the terms "comprising," "including," etc., mean "including but not limited to." In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. In this application, "and / or" describes the relationship between related objects, indicating that three relationships may exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A and B can be singular or plural. In this application, "at least one" means one or more, and "more than one" means two or more. "At least one," "at least one of the following," or similar expressions refer to any combination of these items, including any combination of a single item or a plural item. For example, "at least one of a, b, or c", or "at least one of a, b, and c", can both mean: a, b, c, ab, i.e., a and b, ac, bc, or abc, where a, b, and c can be a single or multiple.
[0056] like Figure 1 and Figure 2 As shown: This application provides a database system configuration parameter tuning algorithm based on load characterization and large model exploration, including:
[0057] A database workload characterization mechanism, wherein the database workload characterization mechanism transmits a connection to a tuning cold start mechanism, wherein the tuning cold start mechanism transmits a connection to a large model enhancement exploration and utilization strategy mechanism;
[0058] Furthermore, in practical applications, workloads are dynamic, and different workloads often have different optimal database configurations. Tuning each new workload from scratch would inevitably waste time and resources. Therefore, this paper attempts to improve the tuning efficiency of target workloads by leveraging the experience gained from similar historical workload tuning tasks. To quickly and accurately find the most similar workload in historical data, it is necessary to characterize the workload;
[0059] Most learning-based database configuration tuning algorithms assume a fixed workload and do not consider the changes in workload during actual application. Therefore, most methods typically lack a cold start mechanism during tuning, starting from scratch for each new workload tuning task. For example, they might use the database's default configuration as the starting point, or use Latin hypercube sampling to randomly and uniformly sample a set of points in the configuration space as the starting configuration point, then combine this with a specific search strategy to find the configuration that achieves the best database performance. This leads to inefficiency and resource waste in the tuning process for new workloads. To address this problem, this invention employs an efficient tuning cold start mechanism.
[0060] The database workload characterization mechanism includes a hierarchical Transformer encoder and a workload reconstruction decoder with self-supervised training; the tuning cold start mechanism includes initialization of the historical tuning knowledge base, workload characterization and similarity matching, and initialization of the exploration configuration set.
[0061] The database workload representation mechanism consists of a set of SQL statements, which describe the database query, update, and insert operations.
[0062] The optimization cold start mechanism constructs a good configuration set as the starting point for the optimization task of the target workload based on the optimization experience of similar historical workloads, thereby reducing the number of iterations required in the subsequent exploration process and the cost of configuration measurement.
[0063] The large model-enhanced exploration and utilization strategy combines the ideas of exploration and utilization. Based on the initial configuration, it further optimizes the configuration of new workloads. In the exploration phase, Latin hypercube sampling is used to randomly and uniformly sample in the configuration space. In the utilization phase, a large model is introduced to perform knowledge reasoning and generate potential high-performance configurations.
[0064] Furthermore, by using the above methods, we can start the tuning process of the target workload from several good initial configuration points, and efficiently explore potential configurations in the configuration space, effectively improving the convergence speed of tuning and reducing time and resource consumption.
[0065] The hierarchical Transformer encoder first encodes each SQL statement in the workload individually based on the statement-level encoder to generate a statement-level semantic vector. Then, it uses a load-level aggregator to fuse all statement features to generate a global workload representation, which specifically includes statement-level encoding and load-level aggregation.
[0066] The statement-level encoding is given a workload W consisting of N SQL statements, i.e., W = {q1, q2, ..., q...}. nFirst, input processing is performed, processing each SQL statement q i Decomposed into word sequence t i,1 , t i,2 , ..., t i,m Based on this, special symbols [CLS_i] and [SEP_i] are added for the start and end positions, and then token embedding and position encoding are performed to obtain the SQL statement q. i input vector x i =(x i,1 x i,2 , ..., x i,m ):
[0067] x i,j =Embedding(t) i,j +PositionEncoding(j)
[0068] Where: x i,j This represents the SQL statement q. i input vector x i In a vector, Embedding represents the mapping function, t i,j This represents the QL statement q i Decomposed into a sequence within the word sequence, PositionEncoding represents the position encoding, j represents the SQL statement q i input vector x i The position of a vector in;
[0069] Then, a statement-level encoder is used to process the input vector x. i The encoding process involves a statement-level encoder composed of L stacked Transformer layers. Each statement shares the encoder's weights, and the final output hidden state vector is:
[0070] h i,j =TransformerEncoder(x i )
[0071] Finally, the hidden state vector at position [CLS_i] is used as the feature vector S of the SQL statement. i :
[0072] S i =h
[0073] Where: TransformerEncoder represents the encoder of the Transformer, and h represents the hidden state vector at the last [CLS_i] position.
[0074] The load-level aggregation is to combine the feature vectors S of N SQL statements. i ={s1, s2, ..., sN The aggregated features are first captured as a global load feature z. A load-level Transformer encoder is then used to capture the dependencies between the feature vectors of the N SQL statements.
[0075] S' = S + PE workload (1,2,...,N)
[0076] {s'1, s'2, ..., s' N} = TransformerEncoder(S')
[0077] Among them: PE workload This represents the position encoding function, where S is the feature vector corresponding to N SQL statements;
[0078] Then, average pooling is used to obtain the global load characteristic z:
[0079] z=AveragePooling(s'1,s'2,...,s' N )
[0080] Where: AveragePooling represents the average pooling function.
[0081] The load reconstruction decoder and self-supervised training also include the following steps:
[0082] S1. Characterize the workload output vector Z∈R from the encoder. d Expanded to a temporal dimension Z'∈R MXd , serving as the global memory vector for the load reconstruction decoder:
[0083] Z' = repeat(z, M) ∈ R MXd
[0084] Where: M is the length of the target sequence;
[0085] S2. A standard Transformer decoder structure is used, incorporating masked self-attention and cross-attention mechanisms. Masked self-attention models the dependencies within the target sequence. In cross-attention, Z' is used as the key and value, and the outputs at each position of the masked self-attention are used as queries, encoding each position to ensure differences in the key and value at different time steps. The memory vector Z' at time t is... t for:
[0086] Z' t =Z+PE(t)∈R d
[0087] Where: Z represents the workload feature vector output by the encoder, and PE represents the position encoding function;
[0088] Generate the j-th word t of the i-th statement sequentially. i,j :
[0089]
[0090] Where: TransformerDecoder represents the decoder of Transformer, and Z' represents the extension vector of the workload feature vector in the temporal dimension;
[0091] S3. Train the designed encoder-decoder model so that the feature vector output by the encoder can accurately characterize the workload. Design different types of learning tasks and reduce the burden of data collection. The encoder-decoder training is driven by a workload reconstruction task. That is, the encoder is input with an SQL sequence containing the workload, and the decoder reconstructs the complete SQL statement sequence autoregressively. The loss function is the sequence cross-entropy loss L. Recon as follows:
[0092]
[0093] Where: P represents a constant, t i,j This represents the j-th word in the i-th statement.
[0094] The historical optimization knowledge base is initialized by storing historical workload feature vectors and their high-performance configurations. When historical data accumulation is lacking, a small number of workloads are generated and several rounds of random searches are performed. The top-K high-performance configurations are selected and added to the knowledge base to complete the initialization of the knowledge base. During the historical data accumulation process, the top-K high-performance configurations discovered during the overall optimization of each workload are added to the knowledge base.
[0095] The workload characterization and similarity matching are performed on new workloads w new The SQL sequence is used to generate feature vectors v using the encoder of the workload2vec model trained by the workload featureization module. new Then, cosine similarity is used to calculate the similarity sim(w) between the new workload and the historical workload. new w his ):
[0096]
[0097] Where: w his Indicates historical workload, v his This indicates that the encoder generates historical feature vectors.
[0098] It should be noted that for OLTP workloads, since the SQL statements executed are randomly generated based on a set transaction weight distribution, special handling is required during workload characterization and similarity matching. The method adopted in this paper is as follows: First, the benchmark test is repeated 10 times under a fixed transaction weight distribution. 50 SQL statements are randomly selected from each generated workload as an approximation of that workload group. Then, the 10 extracted workloads are characterized to obtain the corresponding feature vectors. The average of these features yields the feature vector of the OLTP workload under the transaction weight distribution. Finally, this feature vector is used for similarity matching.
[0099] The initial exploration configuration set selects the Top-K (K=3) historical loads with the highest similarity and uses their corresponding high-performance configurations as the initial exploration configuration set. The configuration parameter tuning process starts from this set containing high-performance configurations of similar workloads.
[0100] Example
[0101] To verify the effectiveness and efficiency of the EfficTune database system configuration parameter tuning algorithm based on load characterization and large model exploration, a comparative experiment was set up, using MySQL database as the configuration parameter tuning object, and comparing it with representative database system configuration parameter tuning algorithms.
[0102] Experimental Datasets: This experiment selected two representative benchmark datasets in the field of database performance testing: TPC-H and TPC-C. (1) The TPC-H benchmark dataset is an OLAP workload that simulates a decision support system for the retail industry. It contains 8 related tables and 22 complex analytical SQL statements, covering typical OLAP operations such as aggregation, multi-table joins, subqueries, and expression calculations. This experiment uses the TPC-H database with a scale factor of 1. (2) The TPC-C benchmark dataset is an online transaction processing (OLTP) database performance benchmark that simulates 5 core transaction types in a typical warehouse management business scenario, which can evaluate the transaction processing capabilities of the database system. In this experiment, the TPC-C database containing 5 warehouses is used.
[0103] Comparison Algorithms:
[0104] (1) BestConfig: A search-based configuration parameter tuning method that proposes divide-and-diverge sampling and recursive bound-and-search search methods to improve the efficiency of searching for the best configuration parameters.
[0105] (2)RFHOC: A classic machine learning-based configuration parameter optimization method that uses a random forest model as a performance prediction model and combines the performance prediction model with a genetic algorithm to find configuration parameters that produce the highest performance.
[0106] (3) SMAC: A parameter tuning method based on Bayesian optimization, which uses random forest as a surrogate model and is widely used in parameter tuning.
[0107] (4) QTune: A database system configuration tuning method based on deep reinforcement learning. It takes into account the rich features of the workload and inputs the query features into the DRL model to select the most suitable configuration.
[0108] Performance comparison metrics: (1) For OLAP type workload TPC-H, this experiment uses the degree of latency reduction (LR) of database execution workload after configuration parameter tuning as the performance comparison metric between different algorithms, which can be defined as:
[0109]
[0110] Where: L baseline L represents the latency of the workload after different algorithm configurations and optimizations. default This refers to the latency of the workload under the default configuration of the database system. (2) For the OLTP type workload TPC-C, this experiment uses the degree of database throughput improvement (TI) after configuration parameter tuning as the performance comparison index between different algorithms, and defines it as:
[0111]
[0112] Wherein: T baseline This refers to the database throughput (number of transactions per second, tx / s) after different algorithm configurations and optimizations. default This refers to the database throughput under the default database system configuration.
[0113] Experimental Results: The specific performance improvements obtained by different algorithms using three configuration metrics to optimize database configuration parameters for TPC-H and TPC-C workloads are shown in Tables 1 and 2. Figure 2 The article provides an overall comparison of the optimization results for the two workloads.
[0114] Table 1 Comparison of algorithm performance under cost constraints for different TPC-H workload configurations
[0115]
[0116] Table 2 Comparison of algorithm performance under different sampling cost constraints for TPC-C workloads
[0117]
[0118] from Figure 2 As can be seen, EfficTune achieved the highest latency reduction (LR) and throughput improvement (TI) on both TPC-H and TPC-C workloads. Calculations show that on TPC-H, EfficTune achieved average latency reductions of 13.90%, 21.43%, 10.13%, and 8.03% compared to BestConfig, RGHOC, QTune, and SMAC, respectively. On TPC-C, EfficTune achieved higher throughput reductions of 15.60%, 18.33%, 9.47%, and 9.80% compared to BestConfig, RGHOC, QTune, and SMAC, respectively. This demonstrates that EfficTune's overall tuning performance is superior to other methods.
[0119] On the other hand, from Figure 2 The results also show that EfficTune, on both the TPC-H and TPC-C workloads, achieves performance improvements close to or even exceeding those of other algorithms using a configuration metric cost of CM=600, with a configuration metric cost of CM=200. This indicates that EfficTune achieves the same tuning effect at a lower cost. Firstly, EfficTune's cold-start mechanism enables the tuning process to begin from several good initial configuration points, effectively reducing the number of iterations required in the exploration phase. In contrast, BestConfig, RFHOC, and SMAC all require tuning from scratch, lacking the utilization of historical tuning data, thus incurring higher tuning costs for new tuning tasks. Secondly, EfficTune also leverages the reasoning capabilities of a large language model to generate potentially promising configurations from already explored high-performance configurations, achieving higher exploration efficiency.
[0120] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed in this application.
Claims
1. A database system configuration parameter tuning algorithm based on load characterization and large model exploration, characterized in that, include: A database workload characterization mechanism, wherein the database workload characterization mechanism transmits a connection to a tuning cold start mechanism, wherein the tuning cold start mechanism transmits a connection to a large model enhancement exploration and utilization strategy mechanism; The database workload characterization mechanism includes a hierarchical Transformer encoder and a load reconstruction decoder with self-supervised training; the tuning cold start mechanism includes initialization of the historical tuning knowledge base, workload characterization and similarity matching, and initialization of the exploration configuration set. The database workload representation mechanism consists of a set of SQL statements, which describe the database query, update, and insert operations. The optimization cold start mechanism constructs a good set of configurations for the optimization task of the target workload based on the optimization experience of similar historical workloads, as the starting point for optimization, thereby reducing the number of iterations required in the subsequent exploration process and the cost of configuration measurement. The large model-enhanced exploration and utilization strategy combines the ideas of exploration and utilization. Based on the initial configuration, it further optimizes the configuration of new workloads. In the exploration phase, Latin hypercube sampling is used to randomly and uniformly sample in the configuration space. In the utilization phase, a large model is introduced to perform knowledge reasoning and generate potential high-performance configurations.
2. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 1, characterized in that: The hierarchical Transformer encoder first encodes each SQL statement in the workload individually based on the statement-level encoder to generate a statement-level semantic vector. Then, it uses a load-level aggregator to fuse all statement features to generate a global workload representation, which specifically includes statement-level encoding and load-level aggregation.
3. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 2, characterized in that: The statement-level encoding is given a workload W consisting of N SQL statements, i.e., W = {q1, q2, ..., q...}. n First, input processing is performed, processing each SQL statement q i Decomposed into word sequence t i,1 , t i,2 , ..., t i,m Based on this, special symbols [CLS_i] and [SEP_i] are added for the start and end positions, and then token embedding and position encoding are performed to obtain the SQL statement q. i input vector x i =(x i,1 x i,2 , ..., x i,m ): x i,j =Embedding(t i,j )+PositionEncoding(j) Where: x i,j This represents the SQL statement q. i input vector x i In a vector, Embedding represents the mapping function, t i,h This represents the QL statement q i Decomposed into a sequence within the word sequence, PositionEncoding represents the position encoding, j represents the SQL statement q i input vector x i The position of a vector in; Then, a statement-level encoder is used to process the input vector x. i The encoding process involves a statement-level encoder composed of L stacked Transformer layers. Each statement shares the encoder's weights, and the final output hidden state vector is: h i,j =TransformerEncoder(x i ) Finally, the hidden state vector at position [CLS_i] is used as the feature vector S of the SQL statement. i : S i =h Where: TransformerEncoder represents the encoder of the Transformer, and h represents the hidden state vector at the last [CLS_i] position.
4. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 2, characterized in that: The load-level aggregation is to combine the feature vectors S of N SQL statements. i ={s1, s2, ..., s N The aggregated features are then used to capture the global load features z. First, a load-level Transformer encoder is used to capture the dependencies between the feature vectors of the N SQL statements. S'=S+PE workload (1,2,…,N) {s’1,s’2,…,s’ N }=TransformerEncoder(S’) Among them: PE woreload This represents the position encoding function, where S is the feature vector corresponding to N SQL statements; Then, average pooling is used to obtain the global load characteristic z: z=AveragePooling(s’1,s’2,…,s’ N ) Where: AveragePooling represents the average pooling function.
5. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 1, characterized in that: The load reconstruction decoder and self-supervised training also include the following steps: S1. Characterize the workload output vector Z∈R from the encoder. d Expanded to a temporal dimension Z'∈R MXd , serving as the global memory vector for the load reconstruction decoder: Z’=repeat(z,M)∈R MXd Where: M is the length of the target sequence; S2. Utilizing the standard Transformer decoder structure, it incorporates masked self-attention and cross-attention mechanisms. Masked self-attention is used to model dependencies within the target sequence, while cross-attention incorporates Z... , Using the outputs of the mask at each position of the self-attention mechanism as keys and values, the outputs are encoded at each position, ensuring that the keys and values differ at different time steps. The memory vector Z at time t... , t for: WITH' t =Z+PE(t)∈R d Where: Z represents the workload feature vector output by the encoder, and PE represents the position coding function; Generate the j-th word t of the i-th statement sequentially. i,j : Where: TransformerDecoder represents the decoder of the Transformer, Z , This represents the extension vector of the workload characterization vector in the time dimension; S3. Train the designed encoder-decoder model so that the feature vector output by the encoder can accurately characterize the workload. Design different types of learning tasks and reduce the burden of data collection. The encoder-decoder training is driven by a workload reconstruction task. That is, the encoder is input with an SQL sequence containing the workload, and the decoder reconstructs the complete SQL statement sequence autoregressively. The loss function is the sequence cross-entropy loss L. Recon as follows: Where: P represents a constant, t i,j This represents the j-th word in the i-th statement.
6. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 1, characterized in that: The historical optimization knowledge base is initialized by storing historical workload feature vectors and their high-performance configurations. When historical data accumulation is lacking, a small number of workloads are generated and several rounds of random searches are performed. The top-K high-performance configurations are selected and added to the knowledge base to complete the initialization of the knowledge base. During the historical data accumulation process, the top-K high-performance configurations discovered during the overall optimization of each workload are added to the knowledge base.
7. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 1, characterized in that: The workload characterization and similarity matching are performed on new workloads w new The SQL sequence is used to generate feature vectors v using the encoder of the workload2vec model trained by the workload featureization module. new Then, cosine similarity is used to calculate the similarity sim(w) between the new workload and the historical workload. new w his ): Where: w his Indicates historical workload, v his This indicates that the encoder generates historical feature vectors.
8. The database system configuration parameter tuning algorithm based on load characterization and large model exploration according to claim 1, characterized in that: The initial exploration configuration set selects the Top-K (K=3) historical loads with the highest similarity and uses their corresponding high-performance configurations as the initial exploration configuration set. The configuration parameter tuning process starts from this set which contains high-performance configurations for similar workloads.