Automatic feedback and continuous learning for query optimization

By using machine learning and hierarchical training techniques, the query optimization model is automatically adjusted, solving the problems of inaccurate model estimation and long training time in existing technologies, and achieving more efficient query optimization and resource utilization.

CN115769198BActive Publication Date: 2026-11-24INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202180047556.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-07-01
Filing Date
2021-06-16
Publication Date
2026-11-24
Estimated Expiration
2041-06-16

AI Technical Summary

Technical Problem

Existing technologies for query optimization suffer from problems such as inaccurate model estimation, long training time, and high cost. They are particularly difficult to adapt to changes in database relationships, leading to suboptimal plans and wasted resources.

Method used

Machine learning methods are employed to update the model through query feedback and runtime feedback, identify errors and automatically adjust model parameters, and utilize hierarchical sampling and hierarchical training techniques to improve the model's adaptability and accuracy while reducing training time and resource consumption.

Benefits of technology

It improves the accuracy and efficiency of query optimization, reduces training time and resource consumption, adapts to changes in database relationships, and optimizes query execution plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115769198B_ABST
    Figure CN115769198B_ABST
Patent Text Reader

Abstract

In methods for improving query optimization in database management systems, embodiments employ a workload feedback process, using query feedback executed during query compilation to identify opportunities for improving cardinality estimation. The method identifies relevance and relationships based on the structure of the query feedback and the executed runtime feedback, and collects data from query execution to identify errors in the query optimizer's estimation. Further, embodiments submit the query feedback and runtime feedback to a machine learning engine to update a set of models. Additionally, embodiments update the set of models based on the submitted query feedback and runtime feedback, and output new, updated, or retrained models based on data collected from query execution to identify errors in the query optimizer's estimation, the submitted query feedback and runtime feedback, or the trained generated models.
Need to check novelty before this filing date? Find Prior Art

Description

Background Technology

[0001] This invention relates generally to the field of query optimization, and more specifically to query optimization for performance in distributed computing environments.

[0002] Query optimization is a feature of many relational database management systems. The query optimizer attempts to determine the most efficient way to execute a given query by considering possible query plans. Typically, once a query is submitted to the database server and parsed by the parser, the query optimizer is not directly accessible to the user. Once queries are submitted and parsed, they are passed to the query optimizer for optimization; however, some database engines allow hints or instructions from the user or source code to guide the query optimizer.

[0003] A query is a request for information from a database. Query results are generated by accessing relevant database data and manipulating that data in a way that produces the requested information. In most cases, database structures are complex, leading to the collection of necessary data for a query from the database through different methods, access paths, and join methods and orders. Each different path and / or method typically requires different processing times. Depending on how the query is executed, the processing time for the same query can vary greatly, from fractions of a second to hours. As an automated process, query optimization aims to find the way to process a given query with the least possible amount of time. The large possible variations in query processing time justify performing query optimization, although finding the exact optimal way to execute a query among all possibilities is often overly complex, time-consuming, expensive, and frequently virtually impossible. Summary of the Invention

[0004] Embodiments of the present invention disclose a method, computer program product, and system for query optimization, the embodiments comprising: identifying opportunities for improving cardinality estimation by a query optimizer using a workload feedback process including query feedback executed during query compilation; identifying relevance and relationships based on the structure of the query feedback and the executed runtime feedback; collecting data from the execution of the query by the query optimizer to identify errors in the query optimizer's estimation; submitting the query feedback and the runtime feedback to a machine learning engine by the query optimizer to update a set of models; updating the set of models by the machine learning engine based on the submitted query feedback and runtime feedback; and outputting a new, updated, or retrained model based on the data collected from the execution of the query to identify errors in the query optimizer's estimation, the submitted query feedback, and the runtime feedback or the trained and generated model. Attached Figure Description

[0005] Embodiments of the invention will now be described by way of example only with reference to the accompanying drawings, in which:

[0006] Figure 1 This is a functional block diagram illustrating a distributed data processing environment according to an embodiment of the present invention;

[0007] Figure 2 The illustration depicts automatic feedback and continuous learning for query optimization according to embodiments of the present invention. Figure 1 A block diagram of automatic feedback and continuous learning components executed on server computers within a distributed data processing environment;

[0008] Figure 3 This illustrates automatic feedback and continuous learning for query optimization according to an embodiment of the present invention. Figure 1 The operational steps of automatic feedback and continuous learning components on computing devices within a distributed data processing environment;

[0009] Figure 4 This illustrates automatic feedback and continuous learning for query optimization according to an embodiment of the present invention. Figure 1 The operational steps of automatic feedback and continuous learning components on computing devices within a distributed data processing environment; and

[0010] Figure 5 The invention describes an embodiment of the invention in Figure 1 A block diagram of the components of a server computer that performs automatic feedback and continuous learning components within a distributed data processing environment. Detailed Implementation

[0011] Embodiments of the present invention recognize that prior art (e.g., cumulative frequency function (CFF) models) has shown that estimation cutoffs of more than an order of magnitude can lead to suboptimal planning (e.g., plans below a predetermined threshold and / or outside a predetermined range), while estimates within an order of magnitude typically yield reasonable planning (e.g., plans above a predetermined threshold and / or within a predetermined range). Therefore, embodiments of the present invention recognize the need for models to learn from their errors and adapt to key data points that may be missed during the sampling step. Embodiments of the present invention improve upon prior art by using machine learning (ML) to adapt to the cumulative changes in database relationships over time.

[0012] Embodiments of the present invention recognize that existing techniques are adaptable to work seamlessly with any model known in the art (e.g., statistical models or small-sample models). Furthermore, the methods associated with embodiments of the present invention are not limited to cardinality estimation but can be used for any aspect of query optimization. For example, the methods associated with embodiments of the present invention can be readily adapted to estimate various costs, such as performance costs and / or economic costs (e.g., operational input / output (I / O), central processing unit (CPU), and / or network or memory usage). Moreover, embodiments of the present invention recognize that various solutions involving the use of statistics as feedback have been implemented in the past by different database vendors; however, none of the implemented solutions bring machine learning capabilities for query optimization.

[0013] Furthermore, embodiments of the present invention recognize that prior art uses deep neural networks to construct query execution plans by continuously learning from previously executed queries. Embodiments of the present invention recognize that a major drawback of currently used methods known in the art is that these methods rely on learning relevance through word similarity in the data, which can produce models that can grow larger than the size of the data itself; furthermore, embodiments of the present invention recognize that applying currently known methods may demonstrate and produce inaccurate results.

[0014] Various embodiments of the present invention recognize that current database systems can collect column statistics and multi-column statistics in automatic or manual modes to be more robust to data changes by considering the statistical correlations between multiple values. Similarly, the CFF model proposed in embodiments of the present invention can be fully retrained when significant data changes occur and the model's predictions begin to accumulate large errors. In this case, automatic feedback is beneficial in triggering the model's retraining action. Embodiments of the present invention measure the performance of the model's estimated cardinality relative to the actual cardinality collected from each individual component of the executed access plan, wherein feedback received from this performance measurement is referred to as observed feedback. Furthermore, once the optimizer identifies that no model has been pre-built on the column relations or groups, the observed feedback can determine and identify which relations and which individual column or group of columns have the potential to build a new model.

[0015] For example, a strong statistical correlation between values ​​in two columns can be a candidate (i.e., containing the possibility of building a new model) because combinations of predicates on those columns will produce a more accurate estimate than the default independence assumption, which may lead to underestimation. Consider a pair of predicates TREE = 'APPLE' AND TYPE = 'RED APPLE', where 40 distinct values ​​in TREE and 2000 distinct values ​​in TYPE are accumulated in a table of 10,000 rows. Apples of the same type may appear in two different trees, and assume there are 2500 unique combinations of TREE and TYPE values, i.e., an average of 4 rows with unique combinations. If the probability on a single column is used (i.e., naively (1 / 40) * (1 / 2000) * 10000 = 0.125 rows), the database optimizer may underestimate the cardinality. However, using the number of distinct combinations, embodiments of the invention generate a more realistic estimate of (1 / 2500) * 10000 = 4 rows. Embodiments of the invention store a list of models and a list of columns used to build the models in a database table. In different embodiments of the invention, the saved list of models and columns may include new and historical (e.g., previously used or generated) models and columns, and / or include new and historical columns that allow for the construction of new models. Furthermore, embodiments of the invention address aspects of serviceability in situations where database users need to report query performance issues to database vendors.

[0016] Serviceability aspects enable testing or regression to a previous model after retraining, wherein the model version and training timestamp are maintained (e.g., stored) so that the model can revert from its current model version to a previous model version based on the maintained model version and training timestamp. For example, if the current model version is 2.2 and the current training timestamp is May 1, 2020, and the most recently maintained model version is 2.1 and the training timestamp is April 29, 2020, then the model will revert to model version 2.1. Alternatively, in another embodiment, embodiments of the invention enable the model to revert from a previous model version to the most current model version.

[0017] Different embodiments of the present invention recognize that the prior art requires feedback loops from runtime components to optimizer components or from feedback loops to optimizer components themselves to account for the retraining of ML models. Furthermore, embodiments of the present invention recognize that the prior art is expensive for training when compared to the proposed invention. Embodiments of the present invention recognize that, in order to train systems in the prior art, systems must either wait for user queries (e.g., depending on the query rate and the diversity of the data (i.e., how the data represents the actual distribution), which may take longer to train the model) or generate and execute queries randomly, which results in significant overhead. Embodiments of the present invention improve upon the prior art by: addressing the aforementioned training and overhead problems by training one or more samples; discovering (i.e., identifying) candidate columns through a predetermined database interface without executing queries against all data (i.e., the entire set of predetermined data); refining the retraining effort using feedback from actual query executions to make the retrained model more relevant to the workload; and making the retraining of ML models more efficient.

[0018] Furthermore, embodiments of the invention propose using machine learning (ML) to adapt to changes in database relationships over time. In different embodiments of the invention, changes to the data involved in the model can trigger retraining if the estimate exceeds or falls within a predetermined value or range of predetermined values ​​derived from actual query execution, actual cardinality, and / or actual distribution. Embodiments of the invention improve upon the prior art by presenting a system for query optimization that builds, efficiently trains, maintains, evaluates, and uses learned or otherwise used models. Furthermore, embodiments of the invention improve upon the prior art by enabling the invention to be applied to any statistical / learning model known in the art, and embodiments of the invention can bridge the gap between data discovery and feedback. Embodiments of the invention recognize that loopback error points will complicate the model and increase model size and inference time.

[0019] Embodiments of the invention recognize that continuous learning is sensitive to model retraining with new data points or to internally weighted model adjustments. Additionally, different embodiments of the invention recognize that iterating over all or randomly selected queries from runtime feedback can bias model predictions. For example, embodiments of the invention selectively learn most of the model's errors via predicate logic, resulting in lower selectivity. In this example, iterating over those points will bias the model towards lower selectivity. Embodiments of the invention can use hierarchical sampling, where categories represent groups of selectivity (e.g., values ​​between 0.0 and 1.0), to improve domain and reduce model bias. For example, using hierarchical sampling over all or randomly selected queries from runtime feedback improves model performance over the same test query without hierarchical sampling.

[0020] The embodiments of the present invention can be implemented in various forms, and details of exemplary implementation methods will follow. Figure 3 (Right now, Figures 1-5 )discuss.

[0021] Figure 1 This is a functional block diagram illustrating a distributed data processing environment, typically represented by 100, according to an embodiment of the present invention. The term "distributed" as used herein describes a computer system comprising multiple physically distinct devices that operate together as a single computer system. Figure 1 This illustration is provided merely as an example of one implementation and does not imply any limitation regarding the environment in which different embodiments may be implemented. Those skilled in the art can make numerous modifications to the depicted environment without departing from the scope of the invention as set forth in the claims. The distributed data processing environment 100 includes computing devices 110 and server computers 120 interconnected via a network 130.

[0022] Network 130 may be, for example, a Storage Area Network (SAN), a telecommunications network, a Local Area Network (LAN), a Wide Area Network (WAN) (such as the Internet), a wireless technology for exchanging data over short distances (using short-wavelength ultra-high frequency (UHF) radio waves in the Industrial, Scientific, and Medical (ISM) band from fixed and mobile devices from 2.4 to 2.485 GHz, and establishing a Personal Area Network (PAN), or a combination of these), and may include wired, wireless, or fiber optic connections. Network 130 may include one or more wired and / or wireless networks capable of receiving and transmitting data, voice, and / or video signals, including multimedia signals containing voice, data, text, and / or video data. Typically, network 130 may be a connection between computing device 110 and server computer 120 and any other computing and / or storage devices within the distributed data processing environment 100. Figure 1 Any combination of connections and protocols for communication between (not shown in the image).

[0023] In some embodiments of the present invention, computing device 110 may be, but is not limited to, a standalone device, client, server, laptop computer, tablet computer, netbook computer, personal computer (PC), smartphone, desktop computer, smart TV, smartwatch, radio, stereo system, cloud-based service (e.g., cognitive cloud-based service), AR glasses, virtual reality headset, any HUD known in the art, and / or any programmable electronic computing device capable of communicating with various components and devices within the distributed data processing environment 100 via network 130, or any combination thereof. Generally, computing device 110 may represent any programmable computing device or combination of programmable computing devices capable of executing machine-readable program instructions and communicating with users of other computing devices via network 130 and / or capable of executing machine-readable program instructions and communicating with server computer 120. In some embodiments, computing device 110 may represent multiple computing devices.

[0024] In some embodiments of the invention, computing device 110 may represent any programmable electronic computing device or a combination of programmable electronic computing devices capable of executing machine-readable program instructions, manipulating executable machine-readable instructions, and communicating via a network (such as network 130) with server computer 120 and other computing devices (not shown) within distributed data processing environment 100. Computing device 110 may include instances of user interface (interface) 106 and local storage device 104. Figure 1 In various embodiments not described herein, computing device 110 may have multiple user interfaces. Figure 1 In other embodiments not described herein, the distributed data processing environment 100 may include multiple computing devices, multiple server computers, and / or multiple networks. The computing devices 110 may include internal and external hardware components, such as those described above. Figure 5 As described and further detailed.

[0025] User interface (interface) 106 provides an interface to automatic feedback and continuous learning component (component) 112. Computing device 110 may enable users and / or clients to interact with component 112 and / or server computer 120 in various ways via user interface 106, such as sending and receiving program instructions, sending and / or receiving messages, updating data, sending data, inputting data, editing data, collecting data, and / or receiving data. In one embodiment, interface 106 may be a graphical user interface (GUI) or a web user interface (WUI) and may display at least text, documents, a web browser window, user options, application interfaces, and operation instructions. Interface 106 may include data presented to the user (such as graphics, text, and sound) and control sequences used by the user to control operations. In another embodiment, interface 106 may be mobile application software that provides an interface between the user of computing device 110 and server computer 120. The mobile application software or “app” may be designed to run on smartphones, tablets, and other computing devices. In one embodiment, interface 106 enables a user of computing device 110 to at least send data, input data, edit data (annotate), collect data, and / or receive data.

[0026] Server computer 120 may be a standalone computing device, management server, web server, mobile computing device, one or more client servers, or any other electronic device or computing system capable of receiving, sending, and processing data. In other embodiments, server computer 120 may represent a server computing system utilizing multiple computers, such as, but not limited to, server systems in a cloud computing environment. In another embodiment, server computer 120 may represent a computing system utilizing a cluster of computers and components (e.g., database server computers, application server computers, etc.) that act as a single seamless resource pool when accessed within the distributed data processing environment 100. Server computer 120 may include internal and external hardware components, such as those relative to... Figure 5 As depicted and further described in detail. In some embodiments, server computer 120 may represent multiple server computers.

[0027] Each of the shared storage device 124 and the local storage device 104 may be a data / knowledge repository and / or database that can be written to and / or read by one or a combination of component 112, server computer 120, and computing device 110. In the depicted embodiment, the shared storage device 124 resides on server computer 120 and the local storage device 104 resides on computing device 110. In another embodiment, the shared storage device 124 and / or the local storage device 104 may reside elsewhere within the distributed data processing environment 100, provided that each is accessible to and can be accessed by computing device 110 and server computer 120. The shared storage device 124 and / or the local storage device 104 may each be implemented using any type of storage device capable of storing data and configuration files accessible and utilized by server computer 120, such as, but not limited to, a database server, hard disk drive, or flash memory.

[0028] In some embodiments of the present invention, the shared storage device 124 and / or the local storage device 104 may each be a hard disk drive, a memory card, a computer output to a laser disk (cold storage device), and / or any form of data storage device known in the art. In some embodiments, the shared storage device 124 and / or the local storage device 104 may each be one or more cloud storage systems and / or databases linked to a cloud network. In various embodiments, the shared storage device 124 and / or the local storage device 104 may access, store, and / or save user data, physical room data, and meeting data, and / or data shared throughout the distributed data processing environment 100.

[0029] In the depicted embodiment, database engine 140 executes on server computer 120. In other embodiments, database engine 140 may execute on computing device 110. Figure 1 In various embodiments of the invention not described herein, the database engine 140 may execute on multiple server computers 120 and / or multiple computing devices 110. As understood in the art, the database engine 140 is an underlying software component used by a database management system (DBMS) to create, read, update, and delete (CRUD) data from a database. In different embodiments of the invention, the database engine 140 (i.e., the database management system) includes an application programming interface (API) that allows users to interact with its underlying engine without going through the DBMS user interface.

[0030] In the depicted embodiment, component 112 executes on database engine 140 on server computer 120. In other embodiments, component 112 may execute on computing device 110. In various embodiments of the invention ( Figure 1(Not depicted in the text) Component 112 may execute on multiple database engines 140, multiple server computers 120, and / or multiple computing devices 110. In some embodiments, component 112 may be located and / or execute anywhere within the distributed data processing environment 100, as long as component 112 is connected to and / or communicates with the database engines 140, computing devices 110, and / or server computers 120 via network 130.

[0031] In various embodiments of the invention, component 112 implements an automatic feedback method, wherein once a query has been executed, component 112 can identify and / or retrieve the actual number of rows for each relation in the query or an operator in the execution plan, and compare the retrieved number of rows with one or more rows based on a predicted cardinality. Cardinality estimates above or below a predetermined threshold can be maintained in a separate table. Tables containing estimated cardinality anomalies compared to actual cardinality anomalies are aggregated to filter out infrequent and secondary feedback data using different algorithms (e.g., filtered infrequent and secondary feedback data may include: relevance, usage frequency, and impact on performance, to keep the data compact and feed it to a component that determines when and how to retrain the model). In various embodiments of the invention, component 112 can filter out infrequent and predetermined feedback, which may include: relevance, usage frequency, and impact on performance, to keep the data compact and feed it to a component that determines when and how to retrain the model. In various embodiments of the invention, component 112 may retain only predicate literals. The next time the model is retrained, component 112 may add the retained literals to materialized samples or new samples randomly collected from the original relations.

[0032] In various embodiments of the invention, depending on the actual implementation of the proposed model (e.g., the CFF model), collected points that missed predictions may be used to adjust model parameters instead of complete retraining. In various embodiments of the invention, component 112 may collect column statistics and multi-column statistics in automatic or manual mode to be more robust to data changes by considering statistical correlations between multiple values. In various embodiments of the invention, the proposed model may be completely retrained when significant data changes occur and the model's predictions begin to accumulate large errors, wherein the significant data changes include changes in data requiring more memory and / or computing power. In another embodiment of the invention, wherein the ML model is used to predict operating costs or memory, the actual operating costs or memory used may be retrieved and compared with the estimated costs and / or memory to determine the accuracy of the estimated costs and / or memory and / or identify any cost or memory savings or areas that can be reduced to justify cost or memory savings.

[0033] In various embodiments of the invention, component 112 can identify when the model's predictions begin to accumulate errors and can activate automatic feedback to trigger a model retraining action. Component 112 can measure the model's performance relative to the actual cardinality collected from each individual component of the executed access plan. Additionally, in various embodiments of the invention, if the optimizer component identifies, based on column relationships or groups, that no model has been pre-built, component 112 can use observed feedback to determine that column relationships or groups have the potential to build a new model. Component 112 can store a list of models and a list of columns used to build the model in a database table on local storage device 104 and / or shared storage device 124, wherein the stored list of models and the list of columns can be retrieved, referenced, and / or compared together with a future list of models and a list of columns used to build the model. In various embodiments of the invention, component 112 can test a new or retrained model and / or fall back to a previous model after retraining during database servicing, wherein the model version and training timestamp are maintained (e.g., stored) so that the model can recover from its current model version to a previous model version based on the maintained model version and training timestamp.

[0034] Figure 2 The illustration depicts automatic feedback and continuous learning for query optimization according to embodiments of the present invention. Figure 1 A block diagram of component 112 communicating with computing device 110 and / or server computer 120 within a distributed data processing environment 100. Figure 2 An illustration of an implementation method is provided, but it does not imply any limitation regarding the environment in which different embodiments may be implemented. Many modifications can be made to the depicted environment by those skilled in the art without departing from the scope of the invention as set forth in the claims.

[0035] In various embodiments of the invention, component 112 may be adaptive and continuously learning; furthermore, component 112 may automate the performance feedback of cardinality estimation (e.g., by querying the predicted number of rows for different operational inputs and outputs in the execution plan). In various embodiments of the invention, component 112 includes two main processes: data discovery and workload feedback. The data discovery process is performed by discovery component 142, which performs analysis on data and metadata (catalog 210) stored in a database and / or received from data inputs to identify relationships and / or correlations within each table and among multiple tables. In various embodiments of the prior invention, component 112 may search and retrieve catalog 210 from online search engines and / or online databases. The data discovery process prepares the system with an existing model (e.g., model 212) available during query compilation and optimization.

[0036] The workload feedback process identifies opportunities to improve cardinality estimation through query optimizer feedback and runtime feedback. Query optimizer feedback is performed by the query optimizer component (optimizer component) 148 during query compilation, where optimizer component 148 can identify relevance and relationships based on the query structure. For example, if the model exists on table "T" with columns C1, C2, C3, but multiple queries include predicates referencing expressions on C2 and C3, such as C2 = 'xyz' AND C4 = 10 AND MOD(C3, 5) = 0, then query feedback will identify that C4 and expression MOD(C3, 5) are missing and should be added to the model during retraining and evaluation. In the depicted embodiment, runtime feedback is performed by runtime engine 146, where runtime engine 146 can collect data from query execution to identify errors critical to performance (e.g., points of missed prediction in the optimizer's estimation as previously described, relative to actual execution feedback). Points of missed prediction can also be used to adjust model parameters instead of retraining the entire model.

[0037] In the depicted embodiment, the machine learning engine (engine) 144 may perform the following steps: evaluation 144a, generating or modifying one or more models 144b, and training one or more models 144c. During the evaluation step (i.e., evaluation 144a), input data from both discovery process data and feedback process data is accumulated, from which a set of models to be built or modified (e.g., model 212) is identified. If the data or workload changes by a predetermined amount, or if model 212 lacks coverage of workload-related attributes (i.e., columns), it may be necessary to retrain one or more models. The evaluation step (i.e., evaluation 144a) includes identifying existing and / or running / operating models (i.e., appropriate models) that already exist, but may need to be retrained if the model no longer achieves the required performance level, or if the model has recently been updated, thereby automatically reverting to the previous model. If the model no longer achieves the required performance level, evaluation 144a may identify whether retraining is necessary. In different embodiments of the invention, during evaluation 144a, engine 144 can identify whether the most recently updated model achieves lower performance than the previous model, and if the updated model achieves lower performance, engine 144 can automatically revert to the previous model.

[0038] In various embodiments of the invention, during evaluation 144a, engine 144 may determine whether an existing model can be augmented with additional predetermined columns that would require more time for retraining, and may identify whether the existing model needs to be appropriately split into two or more models to reduce training time or model size. In various embodiments of the invention, during the generation step (generating or modifying model 144b), engine 144 builds or updates a model (i.e., model 212) based on input requirements from the evaluation step. Model 212 may be one or more models or a collection of models in a database management system. In various embodiments of the invention, during training step 144c, engine 144 may initiate a full initial training of a new model, or may initiate retraining of an existing model, or may perform incremental updates to the model, depending on the evaluation performed in the evaluation step.

[0039] In various embodiments of the invention, during query compilation, the query compiler may look up models stored in a database (shared and / or local storage) or online, retrieve one or more available models, and make them available for use during query optimization. It should be understood that the system is not dependent on the CFF model. This is one embodiment of the invention, and the system is adaptable to work seamlessly with any model, such as learning, development, retrieval, and / or indication (e.g., statistical models or small samples). Furthermore, some embodiments of the invention are not limited to cardinality estimation but can be used for any aspect of query optimization. For example, the method can be readily adapted to estimate different costs of operations, such as I / O, CPU, network, and / or memory usage.

[0040] In various embodiments of the invention, runtime engine 146 may perform implementations of runtime feedback. In various embodiments of the invention, in the context of cardinality estimation, runtime engine 146 may identify and retrieve the actual number of rows for each relation in the query or operator in the execution plan, wherein the actual number of rows may be predetermined. In various embodiments of the invention, runtime engine 146 may compare the retrieved actual number of rows with the predicted cardinality, wherein cardinality estimates higher or lower than a predetermined threshold are stored as points in one or more separate tables, and cardinality estimates within or equal to the predetermined threshold are stored and maintained in the current table. In various embodiments of the invention, the stored points may be added to materialized samples or new randomly collected samples the next time the model is retrained. A list of models and columns used to build one or more models in a database table is stored on local storage device 104 and / or shared storage device 124, wherein the stored list of models and columns may be retrieved and used to resolve future queries, model retraining, model building, and / or any other actions known in the art. In various embodiments of the invention, component 112 may store and / or maintain model versions and training timestamps for new or retrained models. In different embodiments of the invention, component 112 may execute a rollback command to the previous model (i.e., rollback) after retraining based on the stored model version and training timestamp.

[0041] In various embodiments of the invention, optimizer component 148 may perform a continuous learning implementation. In various embodiments of the invention, in the context of cardinality estimation, component 112 may determine and identify whether one or more queries fall below an error threshold (e.g., an error bandwidth of one order of magnitude in one or more queries is considered acceptable) before notifying the optimizer component 148 of any plan changes. Queries that fail to fall below the error threshold are considered candidates for continuous learning.

[0042] Figure 3 This illustrates automatic feedback and continuous learning for query optimization according to embodiments of the present invention. Figure 1 The operational steps (generally designated as 300) of the component 112 that communicates with the computing device 110 within the distributed data processing environment 100. Figure 3 An illustration of an implementation is provided, but does not imply any limitation regarding the environment in which different embodiments may be implemented. Many modifications can be made to the described environment by those skilled in the art without departing from the scope of the invention as set forth in the claims.

[0043] In step 302, component 112 performs data discovery on the data and directory. In various embodiments of the invention, component 112 performs data discovery on the received and / or retrieved directory 210 via discovery component 142, wherein the data discovery process includes discovery component 142 performing analysis on the data and metadata within the database (i.e., directory 210) to identify relationships, skewness, and / or relevance within and between multiple tables. This allows the system to be pre-prepared with a model available during query compilation and optimization. In various embodiments of the invention, discovery component 142 may retrieve and / or receive directory 210 from local storage device 104, shared storage device 124, and / or an online search engine.

[0044] In step 304, component 112 identifies a set of relationships and correlations of interest within each table and across multiple tables in the database. In various embodiments of the invention, component 112 may use a data discovery process (similar to...) Figure 2 The discovery component 142 identifies one or more sets of relationships and correlations of interest within one or more tables and between multiple tables in a database, wherein the data discovery process performs analysis of data and metadata in the database using predetermined criteria. In different embodiments of the invention, one or more sets of relationships and correlations of interest may be identified based on predetermined data, parameters, and / or criteria.

[0045] In step 306, component 112 generates a model or a set of models. In various embodiments of the invention, component 112 may generate the set of models via machine learning engine 144 using a set of relationships and correlations of interest identified using predetermined criteria. In some embodiments, the set of models may be a set of potentially useful models, meaning that the generated models may be useful or usable at some point in time within a certain compatibility. In various embodiments of the invention, component 112 may build or update one or more models via machine learning engine 144 (e.g., based on input requirements from the evaluation step).

[0046] In step 308, component 112 performs runtime feedback. In various embodiments of the invention, component 112 performs runtime feedback via runtime engine 146. In various embodiments of the invention, component 112 may collect data from the execution of the query via runtime engine 146 to identify errors in the optimizer's estimation. Missed predictions can be used to adjust model parameters instead of completely retraining the entire model.

[0047] In step 310, component 112 executes query feedback. In various embodiments, component 112 executes query feedback during query compilation via optimizer component 148. In various embodiments, component 112, via optimizer component 148, can identify relevance and relationships based on one or more query optimizer feedback structures and runtime feedback executed by runtime engine 146.

[0048] In step 312, component 112 identifies opportunities for improving cardinality estimation. In various embodiments of the invention, component 112 may identify opportunities for improving cardinality estimation via an optimization component 148 using a workload feedback process (as described above) that includes query feedback performed by the query optimizer (e.g., optimizer component 148) during query compilation. In various embodiments of the invention, component 112 may identify opportunities for improving cardinality estimation based on query feedback and runtime feedback via optimization component 148. In various embodiments of the invention, component 112 may accumulate and evaluate opportunities from the discovery and feedback process (similar to...) via machine learning engine 144. Figure 2 The evaluation step (evaluation 144a) takes input data from which it identifies a set of models to be built or modified. The evaluation step (i.e., evaluation 144a) includes identifying appropriate models that already exist, but which may require retraining if the model no longer achieves the desired performance level, or automatically reverting to the previous model if it was recently updated. If the model no longer achieves the desired performance level, evaluation 144a can identify whether a retraining operation is needed.

[0049] In step 314, component 112 identifies relevance and relationships based on the query structure and runtime feedback. In different embodiments of the invention, component 112 may identify relevance and relationships of interest based on the query structure and runtime feedback via runtime engine 146.

[0050] In step 316, component 112 collects data from the execution of the query to identify errors in the estimation of the query optimizer. In different embodiments of the invention, component 112 may collect data from the execution of the query via optimizer component 148 to identify errors in the estimation of the query optimizer (i.e., optimizer component 148); and submit query feedback and runtime feedback to machine learning engine 144 to update the set of potentially useful models.

[0051] In step 318, component 112 trains the generated model. In different embodiments of the invention, component 112 may train one or more generated models via machine learning engine 144. In different embodiments of the invention, component 112 may initiate full initial training of a new model, initiate retraining of an existing model, or perform incremental updates of the model via machine learning engine 144, depending on the specific circumstances. Figure 2 The evaluation performed in the evaluation steps.

[0052] In step 320, component 112 outputs a new, updated, or retrained model. In different embodiments of the invention, component 112 may output one or more new, updated, or retrained models via machine learning engine 144 based on data collected from the execution of the query to identify errors in the query optimizer's estimates, the submitted query feedback and runtime feedback, and / or one or more trained and generated models.

[0053] Figure 4 This illustrates automatic feedback and continuous learning for query optimization according to embodiments of the present invention. Figure 1 The operational steps of component 112 communicating with computing device 110 within the distributed data processing environment 100 (overall designated as 400). Figure 4 An illustration of an implementation method is provided but does not imply any limitation regarding the environment in which different embodiments may be implemented. Many modifications can be made to the depicted environment by those skilled in the art without departing from the scope of the invention as set forth in the claims.

[0054] In step 402, component 112 retrieves the actual number of rows for each relation or operator in the query or execution plan. In different embodiments of the invention, component 112 may retrieve the number of rows for one or more relations and / or operators in the query or execution plan, wherein the actual number of rows may be predetermined for one or more relations and / or operators in the query or execution plan.

[0055] In step 404, component 112 identifies cardinality estimates within a predetermined threshold. In different embodiments of the invention, component 112 may determine and identify whether a cardinality estimate is within the predetermined threshold by comparing the retrieved row count with the predicted cardinality.

[0056] In step 406, component 112 stores the cardinality estimate in a separate table. In the depicted embodiment, component 112 may store cardinality estimates above or below a certain threshold (e.g., within a certain predetermined threshold) in a separate compressed structure in memory. In different embodiments of the invention, component 112 may retain only the predicate literal and predicate information.

[0057] In step 408, component 112 adds the stored predicate literals to the materialized sample. In different embodiments of the invention, component 112 may add one or more retained literals to the materialized sample or to a new sample randomly collected from the original relation.

[0058] In step 410, component 112 identifies error accumulation. In different embodiments of the invention, component 112 may identify when the model's predictions begin to accumulate error. In different embodiments of the invention, depending on the actual implementation of the proposed model, the collected points of missed predictions may also be used to adjust the model parameters instead of completely retraining the model again. In different embodiments of the invention, component 112 may collect column statistics and multi-column statistics in automatic or manual mode to be more robust to data changes by considering the statistical correlation between multiple values. In different embodiments of the invention, when a large data change occurs, the proposed CFF model may be completely retrained, and the model's predictions begin to accumulate large errors.

[0059] In step 412, component 112 activates automatic feedback. In different embodiments of the invention, component 112 may activate automatic feedback to trigger a model retraining action.

[0060] In step 414, component 112 measures the performance of the model. In different embodiments of the invention, component 112 may measure the performance of one or more models relative to the actual base collected from one or more individual components of the executed access plan.

[0061] In step 416, component 112 identifies which group of relations in the columns has the potential to build a new model. In different embodiments of the invention, once the optimizer recognizes that no model has been pre-built on the relations or groups of columns, component 112 can use observed feedback to determine and identify which group of relations or groups of columns has the potential to build a new model.

[0062] In step 418, component 112 stores the list of models in a database. In different embodiments of the invention, component 112 may store one or more lists of models and a list of columns used to construct the models in a database table on local storage device 104 and / or shared storage device 124.

[0063] In step 420, component 112 tests the model. In different embodiments of the invention, component 112 may test one or more new or retrained models and / or revert to a previous model after retraining, potentially avoiding database service calls to the database provider. Additionally, in different embodiments, the model version and training timestamp are maintained to automatically or as directed by the database provider to revert to a previous model version (if potential issues arise).

[0064] In step 422, component 112 outputs a model. In different embodiments of the invention, component 112 may output and execute one or more models and / or output and execute a previously executed model (i.e., fall back to a previous model) based on a list of stored models and the model being tested.

[0065] Figure 5 The invention describes an embodiment of the invention in Figure 1 A block diagram of the components of server computer 120 within a distributed data processing environment 100. It should be understood that... Figure 5 This illustration provides only one implementation method and does not imply any limitation regarding the environment in which different embodiments may be implemented. Many modifications can be made to the depicted environment.

[0066] Figure 5 A computer system 500 is depicted, wherein server computing 120 represents an example of a computer system 500 including component 112. The computer system includes a processor 501, a cache 503, memory 502, persistent storage 505, a communication unit 507, an input / output (I / O) interface 506, a display 509, external devices 508, and a communication structure 504. The communication structure 504 provides communication between the cache 503, memory 502, persistent storage 505, communication unit 507, and input / output (I / O) interface 506. The communication structure 504 can be implemented using any architecture designed to transfer data and / or control information between processors (such as microprocessors, communication and network processors, etc.), system memory, peripheral devices, and any other hardware components within the system. For example, the communication structure 504 can be implemented using one or more buses or crossover switches.

[0067] Memory 502 and persistent storage device 505 are computer-readable storage media. In this embodiment, memory 502 includes random access memory (RAM). Typically, memory 502 may include any suitable volatile or non-volatile computer-readable storage medium. Cache 503 is a fast memory that enhances the performance of processor 501 by storing recently accessed data from memory 502 and data near the recently accessed data.

[0068] Program instructions and data used to practice embodiments of the present invention may be stored in persistent storage device 505 and memory 502 for execution by one or more of the respective processors 501 via cache 503. In an embodiment, persistent storage device 505 includes a magnetic hard disk drive. Alternatively, or in addition to a magnetic hard disk drive, persistent storage device 505 may include a solid-state drive, semiconductor storage device, read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or any other computer-readable storage medium capable of storing program instructions or digital information.

[0069] The media used in persistent storage device 505 can also be removable. For example, a removable hard disk drive can be used in persistent storage device 505. Other examples include optical discs and disks, thumb drives and smart cards, which are inserted into the drive to be transferred to another computer-readable storage medium that is also part of persistent storage device 505.

[0070] In these examples, communication unit 507 provides communication with other data processing systems or devices. In these examples, communication unit 507 includes one or more network interface cards. Communication unit 507 can provide communication via physical and / or wireless communication links. Program instructions and data used to practice embodiments of the invention can be downloaded to permanent storage device 505 via communication unit 507.

[0071] I / O interface 506 enables data input and output with other devices that can be connected to each computer system. For example, I / O interface 506 can provide connectivity to external devices 508, such as keyboards, keypads, touchscreens, and / or other suitable input devices. External devices 508 may also include portable computer-readable storage media, such as thumb drives, portable optical discs or disks, and memory cards. Software and data used to practice embodiments of the invention can be stored on such portable computer-readable storage media and can be loaded onto permanent storage device 505 via I / O interface 506. I / O interface 506 is also connected to display 509.

[0072] The display 509 provides a mechanism for displaying data to the user and may be, for example, a computer monitor.

[0073] The procedures described herein are identified based on their implementation in specific embodiments of the invention. However, it should be understood that any particular procedural terminology used herein is for convenience only, and therefore the invention should not be limited to use only in any particular application identified and / or implied by such terminology.

[0074] The present invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions thereon for causing a processor to execute aspects of the present invention.

[0075] A computer-readable storage medium can be any tangible means capable of retaining and storing instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital universal disc (DVD), memory sticks, floppy disks, mechanical encoding devices such as punch cards, or protrusions in recesses having instructions recorded thereon, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium should not be construed as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses passing through fiber optic cables), or electrical signals transmitted through wires.

[0076] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a suitable computing / processing device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network), or to an external computer or external storage device. The network may include copper cables, optical fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to a computer-readable storage medium within the suitable computing / processing device.

[0077] Computer-readable program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​(such as Smalltalk, C++, etc.) and conventional procedural programming languages ​​(such as the "C" programming language or similar programming languages). The computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)) or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs) may be personalized to execute computer-readable program instructions by utilizing state information from the computer-readable program instructions in order to perform aspects of this invention.

[0078] The present invention will now be described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0079] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / actions specified in one or more boxes of a flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner, such that the computer-readable storage medium storing the instructions includes an article of manufacture containing instructions that implement aspects of the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0080] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus, or other device to produce computer-implemented processing, such that the instructions executed on the computer, other programmable apparatus, or other device perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0081] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction comprising one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the figures. For example, depending on the function involved, two consecutively shown blocks may actually be executed substantially simultaneously, or these blocks may sometimes be executed in reverse order. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action or executes a combination of dedicated hardware and computer instructions.

[0082] Various embodiments of the invention have been described for illustrative purposes, but are not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the invention. The terminology used herein has been chosen to best explain the principles of the embodiments, their practical application, or technical improvements over those found in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.

Claims

1. A computer-implemented method for query optimization, the method comprising: The query optimizer uses a workload feedback process, which includes query feedback executed during query compilation, to identify opportunities for improvement in cardinality estimation. The runtime engine identifies relevance and relationships based on the structure of the query feedback and the executed runtime feedback; The query optimizer collects data from the execution of the query to identify errors in the query optimizer's estimation; The query optimizer submits the query feedback and the runtime feedback to the machine learning engine to update the model set; The machine learning engine updates the model set based on the submitted query feedback and runtime feedback; The retrained model is output based on data collected from the execution of the query to identify errors in the query optimizer's estimates, the submitted query feedback and the runtime feedback, or the generated model after training. as well as After retraining, the model reverts to the previous model, where the model version and training timestamps are maintained to restore the current model to the previous version.

2. The computer-implemented method according to claim 1, further comprising: The set of models is generated by the machine learning engine using a set of columns of interest or correlations identified using a predetermined first criterion; The discovery component performs data discovery on the received data and metadata using a predetermined second standard, wherein the data discovery includes performing analysis on the data and metadata to identify relationships and correlations between columns in a table; as well as The data discovery process identifies a set of columns in a database that have relationships or correlations of interest within and between multiple tables.

3. The computer-implemented method according to claim 1, further comprising: The set of models is trained by a machine learning engine, wherein the machine learning engine initiates retraining of existing models based on evaluation.

4. The computer-implemented method according to claim 1, further comprising: Determine to augment the existing model with additional pre-defined columns that will take more time to retrain; as well as The existing model is split into two or more models to reduce training time or model size.

5. The computer-implemented method according to claim 1, wherein, The training includes: Identify candidate columns without performing a query on the entire set of data through a predefined database interface.

6. A computer-implemented method for query optimization, the method comprising: Cardinality estimates within a predetermined threshold are identified by comparing one or more retrieved row counts with one or more rows based on a predicted cardinality. Add one or more retained texts to a materialized sample or a randomly collected new sample; Collect column statistics and multi-column statistics in automatic or manual mode to be more robust to data changes by considering the statistical correlation between multiple values; retrain the model when large data changes occur and the model’s predictions begin to accumulate large errors, wherein the large data changes include data changes that require more memory and / or computing power. Test the retrained model; The model is executed based on the list of stored models and the model being tested. as well as After the model is retrained, it reverts to the previous model, where the model version and training timestamp are maintained to restore the previous version of the current model.

7. The computer-implemented method according to claim 6, further comprising: Retrieves the row numbers of one or more relations or operators in the execution plan of a query; as well as Identifying cardinality estimates within a predetermined threshold, wherein identifying the cardinality estimates within the predetermined threshold includes: The retrieved rows are compared with the cardinality of the one or more predictions.

8. The computer-implemented method according to claim 6, further comprising: The cardinality estimates, which are above or below a certain threshold, are stored in a separate compressed structure in memory.

9. The computer-implemented method according to claim 6, further comprising: Determine to augment the existing model with additional pre-defined columns that will require more time to retrain; as well as The existing model is split into two or more models to reduce training time or model size.

10. A computer program product for query optimization, the computer program product comprising: One or more computer-readable storage devices and program instructions stored on the one or more computer-readable storage devices, the stored program instructions including: Program instructions used by the query optimizer to identify opportunities for improving cardinality estimation using a workload feedback process that includes query feedback executed during query compilation; Program instructions used by the runtime engine to identify relevance and relationships based on the structure of the query feedback and the executed runtime feedback; Program instructions for the query optimizer to collect data from the execution of the query to identify errors in the query optimizer's estimation; A set of program instructions for the query optimizer to submit the query feedback and the runtime feedback to the machine learning engine to update the model; Program instructions for updating the set of models by the machine learning engine based on the submitted query feedback and runtime feedback; Program instructions for identifying errors in the query optimizer's estimates, submitted query feedback and runtime feedback, or the trained model, based on data collected from the execution of the query; and Program instructions used to revert to a previous model after retraining during database service, where the model version and training timestamp are maintained to restore the previous version of the current model.

11. The computer program product according to claim 10, wherein, The stored program instructions also include: Program instructions for determining additional predetermined columns to augment an existing model, which will require more time for retraining; and Program instructions for splitting the existing model into two or more models to reduce training time or model size.

12. A computer system for query optimization, the computer system comprising: One or more computer processors; One or more computer-readable storage devices; Program instructions stored in the one or more computer-readable storage devices for execution by at least one of the one or more computer processors, the stored program instructions including: Program instructions used by the query optimizer to identify opportunities for improving cardinality estimation using a workload feedback process that includes query feedback executed during query compilation; Program instructions used by the runtime engine to identify relevance and relationships based on the structure of the query feedback and the executed runtime feedback; Program instructions for the query optimizer to collect data from the execution of the query to identify errors in the query optimizer's estimation; A set of program instructions for the query optimizer to submit the query feedback and the runtime feedback to the machine learning engine to update the model; Program instructions for updating the set of models by the machine learning engine based on the submitted query feedback and runtime feedback; Program instructions for outputting a retrained model based on data collected from the execution of the query to identify errors in the query optimizer's estimates, submitted query feedback and runtime feedback, or the errors in the trained model; and Program instructions used to revert to a previous model after retraining during database service, where the model version and training timestamp are maintained to restore the previous version of the current model.

13. The computer system according to claim 12, wherein, The stored program instructions also include: Program instructions for generating a set of models by the machine learning engine using a set of relationships or correlations of interest identified using a predetermined first criterion; Program instructions for performing data discovery on received data and metadata by a discovery component using a predetermined second standard, wherein the data discovery includes performing analysis of the data and metadata to identify relationships and correlations between tables; and Program instructions used by a data discovery process to identify sets of relationships or correlations of interest within and between multiple tables in a database.

14. The computer system according to claim 12, wherein, The stored program instructions also include: Program instructions for determining additional predetermined columns to augment an existing model, which will require more time for retraining; and Program instructions to split the existing model into two or more models to reduce training time or model size.

15. A computer system for query optimization, the computer system comprising: One or more computer processors; One or more computer-readable storage devices; Program instructions stored in the one or more computer-readable storage devices for execution by at least one of the one or more computer processors, the stored program instructions including: Program instructions for identifying cardinality estimates within a predetermined threshold by comparing one or more retrieved row counts with one or more rows based on a predicted cardinality; Program instructions for adding one or more retained texts to a materialized sample or a randomly collected new sample; Program instructions for collecting column statistics and multi-column statistics in automatic or manual mode to make data changes more robust by taking into account the statistical correlation between multiple values; Program instructions for retraining a model when significant data changes occur and the model’s predictions begin to accumulate large errors, wherein the significant data changes include data changes that require more memory and / or computing power. Program instructions used to test the retrained model; Program instructions for executing a model based on a list of stored models and the model being tested; and Program instructions for reverting to a previous model after the retraining of the model, wherein the model version and training timestamp are maintained to restore the previous version of the current model.

16. The computer system according to claim 15, wherein, The stored program instructions also include: Program instructions used to retrieve the row numbers of one or more relations in a query or operators in an execution plan; Program instructions for identifying cardinality estimates within a predetermined threshold, wherein the program instructions for identifying cardinality estimates within the predetermined threshold include program instructions for comparing the one or more retrieved row counts with the predicted cardinality; and Program instructions for storing the cardinality estimate above or below a specific threshold in a separate compressed structure in memory.

17. The computer system according to claim 15, wherein, The stored program instructions also include: Program instructions for determining additional predetermined columns to augment an existing model, which will require more time for retraining; and Program instructions for splitting the existing model into two or more models to reduce training time or model size.

Citation Information

Patent Citations

  • Learning from empirical results in query optimization

    US20020198867A1