Efficient machine learning model inference is enabled using adaptive sampling for autonomous database services

By using an adaptive sampling algorithm and a feedback loop of machine learning models to dynamically adjust database statistical collection, the problems of high resource consumption and statistical unavailability in existing technologies are solved, achieving efficient and accurate data statistical collection and rapid calibration of ML models.

CN115735200BActive Publication Date: 2026-07-03ORACLE INT CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ORACLE INT CORP
Filing Date
2021-04-28
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing database systems suffer from high computational resource consumption and statistical unavailability issues that lead to inaccurate tuning automation when collecting and maintaining data statistics. Furthermore, on-demand statistical collection is time-consuming and data types are hard-coded, making it difficult to adapt to changes in data quality and type.

Method used

An adaptive sampling algorithm is adopted, which dynamically adjusts the statistical collection process through iterative sampling and feedback loops of machine learning models. This ensures rapid customization of statistical quality and type, avoids oversampling and undersampling, and reduces computational resource consumption.

Benefits of technology

It improves the efficiency and accuracy of statistical collection, reduces computational resource consumption, supports rapid recalibration of ML models over time, and lowers development and deployment costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115735200B_ABST
    Figure CN115735200B_ABST
Patent Text Reader

Abstract

This paper presents a method for real-time self-optimization in database management systems (DBMS). The adaptive on-the-fly sampling technique described in this paper estimates database content statistics, which a machine learning (ML) model can use to predict configuration settings that save computing resources such as execution time and storage space. In an embodiment, the computer repeatedly samples the database content until a dynamic convergence criterion is met. In each iteration of a series of sampling iterations, a subset of rows from the database table is sampled, and the estimate of the database table's content statistics is adjusted based on the sampled subset of rows. Upon detection of dynamic convergence, the machine learning (ML) model immediately or ultimately predicts optimal values ​​for the configuration settings used for the DBMS based on the content statistics estimate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to database management systems (DBMS) and features such as real-time self-optimization. This paper describes an adaptive just-in-time sampling technique for estimating database content statistics, which machine learning (ML) models can use to predict configuration settings that save computing resources (such as execution time and storage space). Background Technology

[0002] Tuning automation of database services can rely on user data statistics. Collecting data statistics on production systems is costly and consumes valuable computing resources. Existing database engines use dedicated statistics collection modules to collect and continuously maintain data statistics, which reduces system throughput. These modules are limited because statistics are not always available when needed, so tuning automation should not always rely on their use. For example, collection can be turned off to minimize overhead during periods of high server load. Another example is the case of analytics pushdown engines. In this case, statistics collection is deferred until data is offloaded to the analytics engine for efficiency. The unavailability of statistics before offload leads to problems in automating pre-offload decisions, such as determining the number of computers and / or database instances in the analytics cluster, optimal data format, data compression, and data layout.

[0003] To address these issues, some database systems facilitate on-demand statistical collection, such as during histogram creation. This ensures that statistical data is always available, but it presents two problems:

[0004] • On-demand statistical collection can be very time-consuming, as can database tuning analysis of the collected statistics; and

[0005] • The types of statistics collected on demand are hard-coded (typically for query optimization). Customizing statistics is difficult and inappropriate if tuning automation changes over time and / or the dependence on the quality and type of statistics changes.

[0006] Another solution is to manually collect the necessary statistics before database tuning using sampling provided by existing Structured Query Language (SQL) database systems. This can speed up tuning analysis time and facilitate tuning automation to customize the required statistics. However, this approach still has limitations:

[0007] Performance remains a bottleneck because sampling is a function of table size. Even 1% of the sample size of a large table used in analytical workloads can be costly.

[0008] This feature requires knowledge of the sample size (usually expressed as a percentage of the table size). Knowing the optimal sample percentage a priori is difficult, and it is impossible to know whether the statistical quality is sufficient before collection begins.

[0009] Oversampling can cause performance bottlenecks, while undersampling can lead to inaccurate model inference, especially when dealing with small tables or a very small percentage of samples, or when sample scans return empty or near-empty results.

[0010] Therefore, existing methods are not suitable for collecting statistics on demand from large datasets, such as feature extraction, such as inference for machine learning (ML) models presented in this paper. Attached Figure Description

[0011] In the diagram:

[0012] Figure 1 It is a block diagram depicting an example database management system (DBMS) that uses machine learning (ML) and minimal data sampling to optimize and save computing resources such as execution time, volatile memory, and / or persistent storage.

[0013] Figure 2 It is a flowchart depicting an example self-optimization process that the DBMS can execute to autonomously reconfigure itself, thereby saving computer resources such as time and space;

[0014] Figure 3 This is a block diagram illustrating an exemplary embodiment demonstrating additional design options that can be combined;

[0015] Figure 4 This is a block diagram illustrating a computer system on which embodiments of the present invention can be implemented;

[0016] Figure 5 It is a block diagram of a basic software system that can be used to control the operation of a computing system. Detailed Implementation

[0017] In the following description, numerous specific details are set forth for purposes of explanation in order to provide a thorough understanding of the invention. However, it will be understood that the invention can be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form to avoid unnecessarily obscuring the invention.

[0018] General Overview

[0019] The autonomous database service presented in this paper can significantly reduce operational costs by offloading heavy tasks from database administrators. Time-consuming operations such as database tuning, updates, and patching can be automated to also reduce human error. The autonomous service relies on trained machine learning (ML) models that can optimize workload performance, improve availability, or reduce service costs. The ML models in this paper make decisions in real time within the production system. Low-latency tuning automation can be important for interactive user experiences and also avoids undue impact on system throughput. One aspect of real-time tuning analytics is its reliance on extracting data-oriented features from user content, which can be time-consuming. Using static (pre-computed) metadata is insufficient for accurate tuning predictions, thus necessitating efficient on-demand collection of data statistics. Existing methods for collecting statistics slow down such analyses due to input / output (I / O) bottlenecks, and the problem worsens as data size increases.

[0020] The method presented in this paper is based on adaptive sampling that minimizes the statistical collection overhead without sacrificing the accuracy of the ML model. The technique presented in this paper is generally applicable to database management systems (DBMS) and facilitates rapid customization of statistical types and desired accuracy as ML models evolve in production systems.

[0021] The statistical collection method presented in this paper is specifically designed for ML models. This facilitates efficient ML model inference using adaptive sampling algorithms. It also facilitates rapid recalibration of the statistics required for the evolution of ML models over time, as follows:

[0022] • Adaptive Sampling for ML Inference: This approach uses an iterative sampling algorithm to collect statistics by establishing a feedback loop with ML model inference that consumes statistics. This feedback loop encourages the collection process to continue adaptively until a convergence criterion is met, at which point the collection process terminates. This improves collection efficiency, where oversampling becomes expensive. It also improves statistical quality because the collection process is guided by the consumer feedback loop itself, thus also addressing the problem of undersampling.

[0023] • Rapid Recalibration: As ML models evolve in production systems, the type and quality requirements of the statistics needed can change. The approach presented in this paper provides an interface to easily readjust these requirements. First, statistical computation and convergence criteria are exposed as user-defined interfaces. This facilitates customization without costly changes to the core source code of the database engine. Second, the process of finding optimal statistical collection configuration parameters is automated. For example, sample size increases and statistical increment thresholds are determined during the offline model training phase, where the same iterative sampling algorithm is reused.

[0024] • Improve the efficiency of autonomous services: Statistical data can be collected more efficiently because oversampling can be prevented. Once the quality of the statistics is satisfactory, the statistical collection process stops, thus avoiding unnecessary I / O overhead.

[0025] • Minimize end-to-end development and deployment time: The sampling method presented in this paper is geared towards ML models that are already in service. As the ML model ages and evolves, the cost of changing the criteria used to collect statistics becomes minimal. No changes are required to the core source code of the database engine. As the model is updated, only user-defined interfaces need to be adjusted.

[0026] Statistical collections specifically designed for machine learning are novel, as exemplified by the rapid recalibration aspect of the statistical collections mentioned above. These technological improvements can be readily incorporated into best-in-class DBMS products, such as relational DBMSs (RDBMS).

[0027] In this embodiment, the computer repeatedly samples the database content until a dynamic convergence criterion is met. In each iteration of a series of sampling iterations, a subset of rows from the database table is sampled, and the estimated content statistics of the database table are adjusted based on the sampled subset of rows. Upon detection of dynamic convergence, the machine learning (ML) model immediately or ultimately predicts optimal values ​​for the configuration settings used in the DBMS based on the content statistics estimate.

[0028] 1.0 Sample Database Management System

[0029] Figure 1 This is a block diagram depicting an example database management system (DBMS) 100 in an embodiment. DBMS 100 uses machine learning (ML) and minimal data sampling for self-optimization to save computing resources, such as execution time, volatile memory, and / or persistent storage.

[0030] DBMS 100 can be hosted by one or more computers, such as rack servers, blade computers, personal computers, mainframes, virtual computers, or other computing devices. When DBMS 100 has multiple computers, these computers are interconnected via a communication network. DBMS 100 may contain a database containing tables, such as relational tables or column families.

[0031] Database table 110 may reside in volatile and / or non-volatile storage. Database table 110 may have many rows (0-9) and columns, and each column may store as many values ​​as the number of rows in database table 110. Database table 110 has example columns containing example integer values ​​such as -100 and 40, as shown in the figure. For example, the value stored in the example column in row 6 is 200, as shown in the figure.

[0032] DBMS 100 can collect various static and dynamic statistics about database table 110, such as row counts, column counts in composite keys, and value distribution. In an embodiment, content can be dynamically added, removed, or modified, such as according to Data Manipulation Language (DML) statements. Such content manipulation can cause fluctuations in the dynamic statistics of database table 110, which can invalidate some or all of the previously collected statistics. For example, deleting row 6 will decrease the arithmetic mean of the sample column.

[0033] In various embodiments, database table 110 has a fixed or evolving pattern that may or may not be changed, such as according to data definition language (DDL) statements that can add or redefine columns, constraints, and indexes. Such illustrative changes, while seemingly static, can cause dynamic statistics of database table 110 to fluctuate. For example, in various embodiments, dynamic statistics can fluctuate by: a) redefining an example column to store only unsigned integers, or b) creating a unique index on the example column.

[0034] In any case, the performance characteristics of DBMS 100 can depend on the dynamic statistics of database table 110. For example, when database table 110 has few rows, loading it entirely into volatile memory will not cause virtual memory jitter. However, when database table 110 has billions of rows, loading it entirely into volatile memory will cause excessive virtual memory jitter, which will lead to latency such as I / O (input / output) wait (IOWAIT), such as latency due to disk rotation or track seek. Therefore, DBMS 100 can optimize performance by configuring itself and its operations in a way that may depend on the dynamic statistics of database table 110.

[0035] In the example shown, the cardinality of the example column is an important dynamic statistic for database table 110. Column cardinality is the count of distinct values ​​in a column, such as based on a metric like the number of distinct values ​​(NDV). DBMS 100 can use this column cardinality to configure histograms, hash tables, or indexes, such as for grouping, sorting, or joining data. For example, configuring a hash table with more buckets / intervals reduces hash collisions (i.e., time) but increases memory requirements (i.e., space). Therefore, hash table configuration may require a performance trade-off between time and space. Finding the optimal number of intervals can depend on the cardinality of the example column.

[0036] The actual cardinality of the example column, as shown in the figure, is five. This means that the example column contains five distinct values, and the values ​​in the example column are copies of those five distinct values. The actual cardinality can be precisely measured through an index scan, or, if no index is available, through a table scan examining all values ​​stored in the example column across all table rows 0-9, including copies. Table scans are slow due to I / O and can cause jitter in a variety of ways, including: a) virtual memory, or b) database caches such as row caches or block caches. Besides cardinality, other dynamic statistics may require table scans, such as other value statistics for the example column, such as minimum, maximum, arithmetic mean, statistical patterns, variance, standard deviation, and entropy. For example, such value statistics can reveal data skew, which can degrade the performance of a suboptimally configured hash table, for example, by inducing bias in the hash function or imbalance in a multi-level hash tree.

[0037] DBMS 100 avoids table scans for any of those dynamic statistics by: a) sampling only a subset of available values, and b) estimating one or more dynamic statistics from the sampled values. For example, if the speedup is singular, sampling one percent of available values ​​would result in a 100x speedup compared to a table scan. While smaller sample sizes speed up statistical estimation, the smaller the sample size, the less accurate the statistical estimation.

[0038] Therefore, sample size adjustments require a trade-off between faster estimations and suboptimal database configurations that may slow down DBMS 100 and / or increase memory consumption due to inaccuracies. For example, when database tables have billions of rows, a sample size of one-tenth or one-hundredth may provide sufficient accuracy for near-optimal DBMS 100 configuration. However, sampling ten percent of the values ​​shown in the example columns provides an estimate with a base of one, which is one-fifth inaccurate and, in some scenarios, could significantly degrade DBMS 100 performance due to misconfiguration.

[0039] Therefore, the sample size, whether as a percentage of available data or as the number of values, should not be fixed. The sample size should depend on the distribution of values ​​in the available data (e.g., in the example column). Technical difficulties arise when: a) sampling is used to avoid table scans, b) the sample size depends on the value distribution, and c) detecting the value distribution requires avoiding table scans. The method in this paper overcomes this technical problem by incrementally increasing the sample size until statistical convergence is detected based on the following collaboration: content statistics estimation 130, machine learning model 140, optimal value 150, configuration settings 160, and sampling iteration AC dynamics.

[0040] 2.0 Example Self-Optimization Process

[0041] Figure 2 This is a flowchart depicting an example self-optimization process that DBMS 100 can execute to autonomously reconfigure itself, thereby saving computing resources (such as time and space), as discussed above. References Figure 1 discuss Figure 2 .

[0042] Figure 2 The process is performed in two phases. Steps 201-203 occur repeatedly during the iterative AC phase of the sampling phase. Steps 204-205 occur during the tuning phase, which immediately follows or ultimately follows the sampling phase. Step 203 detects when the sampling phase should stop.

[0043] Steps 201-202 can be repeated in each iteration of a sampling iteration sequence such as AC. Various reasons in various embodiments or scenarios can initiate an iteration sequence. Example initiation reasons include: DML statement preparation, such as statements for Open Database Connectivity (ODBC) preparation, the start or completion of a query plan, and the autonomy of the DBMS 100, such as: causing workload fluctuations (such as demand spikes or idleness or jitter), such as being scheduled by timers, phased (such as for archiving or reporting or extract / translate / load (ETL)), resource availability (such as disk space or volatile storage), schematics (such as table truncation or index creation), or database triggering.

[0044] Step 201 samples a subset of rows 0-9 of database table 110. In each sampling iteration AC, step 201 increases the cumulative sample size by an amount that, in various embodiments, is fixed, such as as shown in the figure, or dynamically adjusted. As shown in each iteration, two additional samples are added to the cumulative sample, which grows to four in iteration B and to six in iteration C.

[0045] Once added to the cumulative sample, the sample will remain in the cumulative sample for all subsequent iterations. For the cumulative sample, a disjoint set of samples is added with each iteration. For example, row 4 sampled in iteration A will not be sampled in subsequent iterations, even though row 4 remains in the cumulative sample used for all subsequent iterations BC. However, different sampled rows from the same or different iterations may coincidentally have duplicate values. For example, two samples in iteration C may coincidentally have the same value.

[0046] Rows 7 and 9 are sampled only in iteration C, making the cumulative sample include rows 1-2, 4-5, 7, and 9. Some rows are never sampled, such as rows 3, 6, and 8. Typically, most or almost all rows are not sampled in the sequence of iterations, especially if the database table has many rows.

[0047] In this example, sampling a row requires sampling the values ​​in a sample column stored in that row. A single sample in other examples can include values ​​from multiple columns: the same row or the same snowflake instance, such as a multidimensional star returned during Online Analytical Processing (OLAP). For example, a single sample might require several Structured Query Language (SQL) operators, expressions, and / or user-defined functions (UDFs). Due to expression processing, different values ​​stored in different rows of the same table column can produce the same sampled value. For example, two different timestamps representing different corresponding dates can produce the same sampled month.

[0048] Step 202 adjusts the content statistics estimate of database table 110 based on a subset of the rows from the current sampling iteration and / or the cumulative sample. For example, the minimum value in the example column could be a content statistic that could be estimated to be zero in iteration A. The estimated minimum value would decrease to -100 in iteration B and remain unchanged in iteration C. In an embodiment, the estimated minimum value can be scaled, such as inversely proportional to the sampling ratio. For example, the estimated minimum value could be doubled when the cumulative sample includes half of the available data.

[0049] As shown in the figure, the cardinality of the example column can be content statistics. With sampling, there are 2-4 distinct cumulative values ​​in the corresponding iterative AC. As shown in the figure, the estimated cardinality can be inversely scaled according to the cumulative sampling ratio, such that the estimated cardinality (as adjusted in step 202) can be 10, 7.5, and 6.7 in the corresponding iterative AC. As shown in the figure, the actual cardinality is five. Therefore, based on the increased cumulative sample size, the repeated adjustment in step 202 increases the accuracy of the estimated cardinality.

[0050] However, the improvement in accuracy diminishes with each iteration. As shown in the figure, iteration B revised the estimated cardinality by 25%, but iteration C revised it by only 11%. Therefore, repeated estimates of content statistics more or less monotonically converge to the actual statistics.

[0051] In subsequent iterations, the rate of progress toward actual statistics typically decreases. Therefore, statistical significance increases in earlier iterations but decreases in later iterations. Consequently, later iterations are less important than earlier iterations and can be avoided to save time and power without unduly reducing accuracy.

[0052] Each iteration can end at step 203, which checks whether one or more dynamic convergence criteria are met. In various embodiments, if one or all convergence criteria are met, the iteration stops and step 204 can occur immediately or eventually. If step 203 does not detect dynamic convergence, the iteration continues by repeating steps 201-202 in the next iteration.

[0053] Various embodiments may have various dynamic convergence thresholds, such as: maximum number of iterations, maximum time, maximum cumulative sample size, maximum cumulative sampling ratio, and minimum percentage or absolute change in content statistics estimates. As shown, step 203 can stop iteration by detecting the following: three iterations have occurred, the iteration has taken more than 900 milliseconds, more than half of the available data has been cumulatively sampled, and / or the estimated cardinality has changed by less than 15% in iteration C. Embodiments may extend iterations beyond convergence thresholds such as the estimated percentage change, for example, to achieve at least the following minimum amounts: number of iterations, time, cumulative sample size, and / or cumulative sampling ratio. In various embodiments or examples, the corresponding UDF may calculate one of the following: the sample size for one or all iterations, the cumulative distinct values ​​or other sampling-based facts, the estimated statistics (such as the estimated cardinality, the estimated percentage or absolute change between iterations, and convergence detection).

[0054] Content statistics estimate 130 is: a) the cardinality of the estimated example columns, b) the results of the sampling phase, and c) computed by the last iteration C in step 202. Based on content statistics estimate 130, machine learning (ML) model 140 predicts an optimal value 150 for configuration settings 160 for DBMS 100 in step 204. For example, configuration settings 160 may be the hash value width in bits or bytes; a wider hash value may be counterintuitively faster by minimizing hash collisions, and a narrower hash value may counterintuitively cause the hash table to consume more memory. Therefore, configuration settings 160 may require a trade-off between time and space, and the optimal value 150 is the so-called sweet spot of the prediction, which may depend on dynamic conditions such as content statistics estimate 130.

[0055] Calculating the optimal value 150 may require mathematical optimization, which is the purpose of ML model 140. ML model 140 can predict / infer the optimal value 150 from numerical and / or symbolic inputs (including content statistical estimates, such as 130). In various examples, ML model 140 can be a random forest, a linear or logistic regressor, an artificial neural network (ANN), or a support vector machine (SVM). In this example, ML model 140 has been trained, such as through reinforcement learning, such as with a corpus of training data, such as through gradient descent, and / or as discussed later in this paper. Depending on the nature of the configuration settings 160, the optimal value 150 can be numerical or categorical / symbolic. For example, the optimal value 150 can be a Boolean value such as a configuration toggle or a categorical value such as selecting one of the listed hash table types or one of the listed hash functions.

[0056] In step 205, DBMS 100 autonomously reconfigures itself by assigning the optimal value 150 to configuration setting 160. In another example, step 205 may assign the corresponding optimal value to multiple configuration settings, such as hash value width, hash interval count, and hash function, as required for formulating, configuring, and / or executing query plans. Multiple configuration settings may have corresponding optimal values ​​predicted by the same or different ML models of the same or different model types. For example, the hash value width and hash interval count may be predicted by the same linear regressor, and the hash function may be selected by an SVM. The individual optimal values ​​may not share, or may share some or all of their available inputs, such as content statistics estimates, such as 130. For example, the linear regressor and SVM may accept the same content statistics estimate 130 as input, but the SVM may require additional inputs, including estimates of other content statistics for the same or different table columns in the same or different database tables.

[0057] Depending on the scenario, the same sampled row 2 of table 2 can contribute values ​​from the same or different columns(s) during the same sampling iteration to estimate different content statistics. For example, the same sampled values ​​from the example column can affect the cardinality, maximum value, and arithmetic mean of the estimates. In another example, different columns of the same sampled row 2 of table 2 contribute corresponding values ​​to the estimates of different content statistics, such as the corresponding variances.

[0058] Because dynamic convergence during sampling iterations depends on the content of the database table and the semantics of the statistics, convergence may occur in different iterations within the same sampling phase for different content statistics. For example, the cardinality estimate of a sample column converges in iteration C, but the estimate of the minimum or pattern of the same sample column may require additional iterations. Similarly, the same cardinality estimation function can converge in different iterations for different corresponding columns of the same database table. For example, variance estimates of two columns of the same integer data type in the same database table can converge in different iterations, even if both estimates have the same table rows available for sampling.

[0059] The ML model 140 should be trained in a laboratory before being deployed to a production environment. In an embodiment, the ML model 140 is trained with a corpus that includes: real database content, such as that from production, such as when sampling is required for training, and / or, in the case of supervised learning, actual content statistics that are avoided during training (such as when sampling is avoided during training).

[0060] In an embodiment, supervised training of the ML model 140 includes a validation and / or testing phase, which requires: a) invoking the ML model 140 based on estimated content statistics, which predict a first optimal value 150 based on sampled actual content, and b) invoking the ML model 140 based on actual statistics of the same actual content to predict a second optimal value 150 for the same configuration settings 160. During validation or testing, the first and second optimal values ​​150 may be compared with scores or otherwise evaluated for the fitness / readiness of the ML model 140.

[0061] As explained above, ML model 140 participates in step 204 of the tuning phase and only needs to be called once, so that the optimal value 150 is calculated only once. One embodiment may also incorporate ML model 140 into step 203, which detects when to stop the sampling phase. As explained above, the dynamic convergence detection in step 203 can monitor the relative or absolute change in the estimated content statistics (such as the estimated cardinality).

[0062] The embodiment may additionally or alternatively invoke the ML model 140 in step 203 of each sampling iteration to monitor the relative or absolute magnitude of the change in the repeatedly computed optimal value 150. For example, convergence occurs when the optimal value 150 changes by less than a relative or absolute threshold. Thus, the ML model 140 can participate in a feedback control loop that detects when to stop iterative sampling.

[0063] 3.0 Exemplary Embodiment

[0064] Figure 3 This is a block diagram depicting the following exemplary embodiments, which demonstrate additional design options that can be combined with the embodiments previously presented herein. These additional design options are not requirements of the embodiments previously presented herein.

[0065] During the experimental study, an exemplary embodiment sampled a database table with a total size of 100GB (400 million rows). For the three columns of the database table, an adaptive estimate of the average column string length statistic was performed. The statistics converged to only 0.01% of the sample size, providing a 10x speedup compared to a fixed sample size of 0.1%, and a 900x speedup compared to a table scan with all available rows.

[0066] Exemplary embodiments can be implemented using user-defined components for use within a central statistical collection loop that includes ML model inference. These user-defined components I-IV are:

[0067] I. The types of statistics collected;

[0068] II. Utility function 320, which is defined as a feedback loop between collected statistics and inference results;

[0069] III. Convergence criterion function 330, which determines how early to terminate the collection process; and

[0070] IV. Adaptive Sampling 340 provides a central loop that connects the above components I-III together.

[0071] The details of each of the user-defined components I-IV are as follows:

[0072] I. User-defined statistics 310: Various required statistical data define the feature inputs for ML model inference. For example, a specific feature could be the count of values ​​in a text column whose string length exceeds 100 characters. Providing an interface for user-defined statistics 310 facilitates direct customization by the user. The interface for user-defined statistics 310 includes: statistical value calculation functions 312, statistical states 313, and statistical target data types 311, which will be discussed later.

[0073] II. User-Defined Utility Function 320: The user-defined utility function 320 establishes a feedback loop between the ML model inference (statistical consumer) and the collection process (statistical producer). As discussed later in this paper, this facilitates measuring the quality of statistics according to a user-defined quality criterion 331, rather than the accuracy of the collected individual statistics. The user-defined utility function 320 returns a single score used to determine the termination condition for statistical collection. ML model inference may require the collection of multiple statistics, which are subsequently used as features, either directly or through additional transformations. However, not all features are equally important to the inference process. The user-defined utility function 320 can be an important mechanism for determining the sufficient quality criterion 331 for the collected statistics. For example, in a simple linear regression model use case, the user-defined utility function 320 can be the ML model inference value itself, where the ML model output can be used to determine the utility of the collected statistics (input features). For more complex models, such a function can be implemented using a weighted average of feature ranks.

[0074] III. User-defined convergence criterion 330: One of the central ideas in the exemplary embodiment is determining when to terminate the statistical collection process. Early termination reduces the overall latency of ML model inference and improves efficiency. The score generated by the user-defined utility function 320 is used to determine termination given a certain user-defined convergence criterion 330 (termination strategy). As discussed later herein, multiple convergence criteria can work together.

[0075] IV. Adaptive Sampling 340: Components I-III defined above are bundled together using a central loop that adaptively increases the amount of data accessed for calculating statistics. Finally, the loop terminates based on a user-defined utility function 320 score and a convergence criterion 330. The main responsibilities of this loop will be presented later in this paper.

[0076] 3.1 Exemplary Interface for User-Defined Statistical Types The interface for user-defined statistics 310 includes the following statistical elements QS:

[0077] Q. Target Data Type for Statistics 311: This mapping allows users to restrict the collection of statistics for specific data types. For example, a user might only want to calculate the average string length statistics for string type columns, since the width statistics for fixed-width columns can already be obtained using table metadata (such as relation schemas).

[0078] R. Statistical Computation Functions 312: User-defined functions that implement algorithms for calculating statistics. This can be a direct increment of a counter for cardinality-related statistics, or a complex algorithm (such as Hyperloglog) to calculate the number of distinct values ​​(NDV).

[0079] S. Statistical State 313: Statistical computation algorithms require in-memory statistical state 313. For calculating the average, this can be an integer containing the run counts and sums to calculate the average. For Hyperloglog++, which offers increased accuracy and reduced memory usage compared to Hyperloglog, this can be achieved by compressing a sketch representation to keep track of the number of distinct values.

[0080] 3.2 Exemplary Dynamic Convergence Criteria

[0081] Various combinations of dynamic convergence criterion 330 (such as TW) can work together as follows:

[0082] T. Statistical Quality 331: Using this strategy, if the score provided by the user-defined utility function 320 remains substantially unchanged (i.e., exceeds the user-provided threshold), then the collection process is terminated.

[0083] U. Data Volume 332: The maximum number of rows accessed during collection can be defined as a fault-safe mechanism. If the user-defined utility function 320 does not converge, this strategy will prevent scanning the entire table.

[0084] V. Time Budget 333: Furthermore, the collection process can be defined by duration so that statistics can be completed within a reasonable timeframe. This is particularly useful if table unavailability (due to locking) delays or prevents the collection process.

[0085] W. Database Activity 334: Statistical collection for ML model inference should be performed on the production system, which is risky because fluctuations in production demand can jeopardize reliability, availability, and serviceability (RAS), such as during demand spikes. For example, statistical collection can further increase system stress at the worst possible time. Instead, collection can be temporarily postponed until when database activity is low, or the statistical collection process can be terminated early during unexpected demand spikes.

[0086] 3.3 Exemplary Central Loop for Adaptive Sampling

[0087] The main responsibilities of the central loop 340 for adaptive sampling are as follows:

[0088] X. Verification 341: The central loop performs all metadata checks to ensure that users have the right to access the data and that the data types collected for use with the statistical target type mapping defined earlier in this document are supported. This loop performs error handling and skips any data sources in case of unsupported types or data unavailable due to locking, access restrictions, or corruption.

[0089] Y. Iterative Sampling 342: This method uses a sample iterator provided by the database storage engine to access uniform random samples. Iterative sampling can be performed at the row granularity or a set of rows (e.g., 512 rows or a database block containing fixed or varying amounts of rows) 342. The sample iterator provides access to new data to increase the total sample size at each step. This method ensures that all statistics for all columns are computed when accessing a new sample. For each new sample, a statistical calculation function is used and the statistical state is updated based on the data sampled so far 313.

[0090] Z. Adaptive Convergence 343: Once the samples have been processed, the output from the user-defined utility function 320 is computed and the convergence criterion 330 is tested to determine the end of the collection process. This ensures that the collection process terminates early with reasonable quality.

[0091] 3.4 Exemplary ML Model Lifecycle

[0092] As ML models evolve over time, they may need to be retrained and redeployed on production systems. This can require changes to the input feature set based on data statistics. An exemplary embodiment is based on a user-defined interface that is easily updated. The interface is implemented as a database UDF object, thus isolating updates from the internal database engine codebase.

[0093] After updating the user-defined interface, the only remaining task is tuning the configuration parameters for the adaptive sampling algorithm 340. This can include configuration parameters such as the convergence criterion increment threshold, the maximum number of rows limit, and the sample increment size in each iteration. While configuration parameters can be easily tuned manually, the experiment relies on automated processes involving the trained ML model itself, such as those discussed in the embodiments presented earlier in this paper. These configuration parameters are related to... Figure 1 The configuration settings are different for 160.

[0094] Users can use real statistics during offline ML model training. Once the ML model is trained, configuration parameters are discovered by calculating the deviation between ML model inference using real statistics and ML model inference using an adaptive sampling technique of 340. Gradient descent, as a function of configuration parameters, can be used to minimize deviations such as those during backpropagation, as discussed later in this paper.

[0095] 4.0 Database Overview

[0096] Embodiments of the present invention are used in the context of a database management system (DBMS). Therefore, a description of an example DBMS is provided.

[0097] Generally speaking, a server (such as a database server) is a combination of integrated software components and computing resources (such as memory, nodes, and processes on those nodes for executing the integrated software components), where the combination of software and computing resources is dedicated to providing a specific type of functionality on behalf of clients. A database server governs and facilitates access to a specific database, handling client requests to access that database.

[0098] Users interact with the DBMS database server by submitting commands to it, which in turn cause the database server to perform operations on the data stored in the database. A user can be one or more applications running on the client computer interacting with the database server. Multiple users may also be collectively referred to as users in this document.

[0099] A database consists of data stored on a persistent storage mechanism (such as a set of hard disks) and a database dictionary. A database is defined by its own separate database dictionary. The database dictionary contains metadata that defines the database objects contained within the database. In fact, the database dictionary defines most of the database's content. Database objects include tables, table columns, and tablespaces. A tablespace is a collection of one or more files used to store data for various types of database objects, such as tables. If the data for a database object is stored in a tablespace, then the database dictionary maps the database object to one or more tablespaces that hold that database object's data.

[0100] The DBMS references the database dictionary to determine how to execute database commands submitted to the DBMS. Database commands can access database objects defined by the dictionary.

[0101] Database commands can take the form of database statements. For a database server to process a database statement, the statement must conform to a database language supported by the database server. A non-limiting example of a database language supported by many database servers is SQL, including proprietary forms of SQL supported by database servers such as Oracle (e.g., Oracle Database 11g). SQL Data Definition Language (“DDL”) instructions are issued to the database server to create or configure database objects, such as tables, views, or complex types. Data Manipulation Language (“DML”) instructions are issued to the DBMS to manage data stored in the database structure. For example, SELECT, INSERT, UPDATE, and DELETE are examples of common DML instructions in some SQL implementations. SQL / XML is a common extension of SQL used when manipulating XML data in object-relational databases.

[0102] A multi-node database management system consists of interconnected nodes that share access to the same database. Typically, nodes are interconnected via a network and share access to shared storage devices to varying degrees, such as sharing access to a set of disk drives and the blocks of data stored thereon. Nodes in a multi-node database system can be in the form of a group of computers interconnected via a network, such as workstations and / or personal computers. Alternatively, nodes can be nodes in a grid, which consists of nodes in the form of server blades interconnected with other server blades on a rack.

[0103] In a multi-node database system, each node hosts a database server. A server (such as a database server) is a combination of integrated software components and computing resources (such as memory, nodes, and processes on the nodes for executing the integrated software components on the processor), a combination of software and computing resources dedicated to performing a specific function on behalf of one or more clients.

[0104] Resources from multiple nodes in a multi-node database system can be allocated to software running a specific database server. Each combination of software and resource allocation from the nodes is a server referred to herein as a "server instance" or "instance". A database server may include multiple database instances, some or all of which may run on separate computers (including separate server blades).

[0105] 4.1 Query Processing

[0106] A query is a set of expressions, commands, or instructions that, when executed, cause a server to perform one or more operations on a set of data. A query can specify one or more source data objects, such as tables, columns, views, or snapshots, from which to determine one or more result sets. For example, one or more source data objects can appear in the FROM clause of a Structured Query Language (“SQL”) query. SQL is a well-known example language for querying database objects. As used herein, the term “query” is used to refer to any form of query, including queries in the form of database statements and any data structure used for inner query representation. The term “table” refers to any source object that is referenced or defined by a query and represents a set of rows, such as a database table, view, or inline query block (such as an inline view or subquery).

[0107] Queries can perform operations on data from one or more source data objects row by row as the objects(s) are loaded, or on the entire source data objects(s) after the objects(s) have been loaded. The result set generated by one or more operations(s) can be made available to one or more other operations(s), and in this way, the result set can be filtered or narrowed based on certain criteria, and / or combined or joined with other result sets(s) and / or one or more other source data objects(s).

[0108] A subquery is a part or component of a query that is distinct from the other parts or components of the query and can be evaluated separately from the other parts or components of the query (i.e., as a separate query). The other parts or components of the query can form an outer query, which may or may not include other subqueries. When evaluating the results for the outer query, subqueries nested within the outer query can be evaluated individually once or multiple times.

[0109] Generally, a query parser receives a query statement and generates an internal query representation of the query statement. Typically, the internal query representation is a collection of interrelated data structures that represent the various components and structure of the query statement.

[0110] An internal query representation can be in the form of a graph of nodes, where each interconnected data structure and node corresponds to a component of the represented query statement. The internal representation is typically generated in memory for evaluation, manipulation, and transformation.

[0111] Hardware Overview

[0112] According to one embodiment, the techniques described herein are implemented by one or more dedicated computing devices. The dedicated computing device may be hardwired to execute these techniques, or may include digital electronic devices such as one or more application-specific integrated circuits (ASICs) or field-programmable gate arrays (FPGAs) persistently programmed to execute these techniques, or may include one or more general-purpose hardware processors programmed to execute these techniques according to program instructions in firmware, memory, other storage devices, or a combination thereof. Such a dedicated computing device may also combine custom hardwired logic, ASICs, or FPGAs with custom programming to implement these techniques. The dedicated computing device may be a desktop computer system, a portable computer system, a handheld device, a networking device, or any other device that combines hardwired and / or program logic to implement these techniques.

[0113] For example, Figure 4 This is a block diagram illustrating a computer system 400 on which embodiments of the present invention can be implemented. The computer system 400 includes a bus 402 or other communication mechanism for transmitting information, and a hardware processor 404 coupled to the bus 402 to process information. The hardware processor 404 may be, for example, a general-purpose microprocessor.

[0114] Computer system 400 also includes main memory 406, such as random access memory (RAM) or other dynamic storage devices, coupled to bus 402, for storing information and instructions to be executed by processor 404. Main memory 406 can also be used to store temporary variables or other intermediate information during the execution of instructions executed by processor 404. When stored in non-transitory storage media accessible to processor 404, these instructions make computer system 400 a dedicated machine customized to perform the operations specified in the instructions.

[0115] Computer system 400 also includes a read-only memory (ROM) 408 or other static storage device coupled to bus 402 for storing static information and instructions for processor 404. Storage device 410 (such as a disk, optical disk, or solid-state drive) is provided and coupled to bus 402 for storing information and instructions.

[0116] Computer system 400 can be coupled to display 412 (such as a cathode ray tube (CRT)) via bus 402 for displaying information to the computer user. Input device 414, including alphanumeric keys and other keys, is coupled to bus 402 for transmitting information and command selections to processor 404. Another type of user input device is cursor control 416 (such as a mouse, trackball, or arrow keys) for transmitting directional information and command selections to processor 404 and for controlling cursor movement on display 412. Such input devices typically have two degrees of freedom on two axes, a first axis (e.g., x) and a second axis (e.g., y), which facilitates the device's position in a specified plane.

[0117] Computer system 400 may implement the techniques described herein using custom hardwired logic, one or more ASICs or FPGAs, firmware and / or program logic (which, in conjunction with the computer system, enable or program the computer system 400 as a special-purpose machine). According to one embodiment, computer system 400 performs the techniques described herein in response to processor 404 executing one or more sequences of one or more instructions contained in main memory 406. These instructions may be read into main memory 406 from another storage medium (such as storage device 410). Execution of the sequence of instructions contained in main memory 406 causes processor 404 to perform the processing steps described herein. In alternative embodiments, hardwired circuitry may be used instead of or in combination with software instructions.

[0118] As used herein, the term "storage medium" refers to any non-transitory medium that stores data and / or instructions that enable a machine to operate in a particular manner. Such storage media can include non-volatile media and / or volatile media. Non-volatile media include, for example, optical discs, magnetic disks, or solid-state drives, such as storage device 410. Volatile media include dynamic memory, such as main memory 406. Common forms of storage media include, for example, floppy disks, flexible disks, hard disks, solid-state drives, magnetic tape or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with a perforated pattern, RAM, PROMs and EPROMs, FLASH-EPROMs, NVRAMs, any other memory chips or cartridges.

[0119] Storage media differ from transmission media but can be used in conjunction with them. Transmission media participate in the transfer of information between storage media. For example, transmission media include coaxial cables, copper wires, and optical fibers, including conductors containing bus 402. Transmission media can also take the form of sound waves or light waves, such as those generated during radio wave and infrared data communication.

[0120] Various forms of media can be used to transfer one or more sequences of one or more instructions to processor 404 for execution. For example, instructions may initially be carried on a disk or solid-state drive of a remote computer. The remote computer may load the instructions into its dynamic memory and transmit them over a telephone line using a modem. A modem local to computer system 400 may receive data over the telephone line and convert the data into an infrared signal using an infrared transmitter. An infrared detector may receive the data carried in the infrared signal, and appropriate circuitry may place the data on bus 402. Bus 402 transfers the data to main memory 406, from which processor 404 retrieves and executes the instructions. Instructions received by main memory 406 may optionally be stored on storage device 410 before or after execution by processor 404.

[0121] Computer system 400 also includes a communication interface 418 coupled to bus 402. Communication interface 418 provides bidirectional data communication coupled to network link 420, which is connected to local network 422. For example, communication interface 418 may be an Integrated Services Digital Network (ISDN) card, a cable modem, a satellite modem, or a modem providing data communication connectivity with a corresponding type of telephone line. As another example, communication interface 418 may be a Local Area Network (LAN) card to provide data communication connectivity with a compatible LAN. A wireless link may also be implemented. In any such implementation, communication interface 418 transmits and receives electrical, electromagnetic, or optical signals carrying streams of digital data representing various types of information.

[0122] Network link 420 typically provides data communication to other data devices via one or more networks. For example, network link 420 may provide a connection via local network 422 to host computer 424 or to data devices operated by Internet Service Provider (ISP) 426. ISP 426 then provides data communication services via a global packet data communication network (now commonly referred to as the "Internet" 428). Both local network 422 and Internet 428 use electrical, electromagnetic, or optical signals carrying digital data streams. Signals through various networks, as well as signals on network link 420 and through communication interface 418 (which carry digital data to or from computer system 400), are example forms of transmission media.

[0123] Computer system 400 can send messages and receive data, including program code, through one or more networks, network links 420, and communication interfaces 418. In the Internet example, server 430 can send requested code to the application through the Internet 428, ISP 426, local network 422, and communication interface 418.

[0124] The received code can be executed by processor 404 upon receipt and / or stored in storage device 410 or other non-volatile memory for later execution.

[0125] Software Overview

[0126] Figure 5 This is a block diagram of a basic software system 500 that can be used to control the operation of computing system 400. Software system 500 and its components, including their connections, relationships, and functions, are merely exemplary and are not intended to limit the implementation of one or more example embodiments. Other software systems suitable for implementing one or more example embodiments may have different components, including components with different connections, relationships, and functions.

[0127] Software system 500 is provided to guide the operation of computing system 400. Software system 500, which may be stored on system memory (RAM) 406 and fixed storage devices (e.g., hard disk or flash memory) 410, includes a kernel or operating system (OS) 510.

[0128] OS 510 manages the low-level aspects of computer operations, including managing process execution, memory allocation, file input and output (I / O), and device I / O. One or more applications, designated 502A, 502B, 502C...502N, can be "loaded" (e.g., transferred from fixed storage device 410 to memory 406) for execution by system 500. Applications or other software intended for use on computer system 400 can also be stored as downloadable computer-executable instruction sets, for example, for downloading and installing from internet locations (e.g., web servers, app stores, or other online services).

[0129] Software system 500 includes a graphical user interface (GUI) 515 for receiving user commands and data graphically (e.g., "click" or "touch gestures"). These inputs can then be manipulated by system 500 according to instructions from operating system 510 and / or (one or more) applications 502. GUI 515 also displays the results of operations from OS 510 and (one or more) applications 502, allowing the user to provide additional input or terminate the session (e.g., log off).

[0130] OS 510 can execute directly on the bare hardware 520 of computer system 400 (e.g., one or more processors 404). Alternatively, a hypervisor or virtual machine monitor (VMM) 530 can be interposed between the bare hardware 520 and OS 510. In this configuration, VMM 530 acts as a software “buffer” or virtualization layer between OS 510 and the bare hardware 520 of computer system 400.

[0131] VMM 530 instantiates and runs one or more virtual machine instances (“guests”). Each guest includes a “guest” operating system (such as OS 510) and one or more applications (such as Application 502) designed to run on the guest operating system. VMM 530 presents a virtual operating platform to the guest operating system and manages the execution of the guest operating system.

[0132] In some instances, VMM 530 can facilitate the operation of a guest operating system (OS) as if it were running directly on the bare hardware 520 of the computer system 400. In these instances, the same version of the guest operating system configured to run directly on the bare hardware 520 can also run on VMM 530 without modification or reconfiguration. In other words, VMM 530 can provide full hardware and CPU virtualization to the guest operating system in some situations.

[0133] In other instances, guest operating systems can be specifically designed or configured to run on VMM530 for improved efficiency. In these instances, the guest operating system is "aware" that it is running on a virtual machine monitor. In other words, VMM530 can provide paravirtualization to guest operating systems under certain circumstances.

[0134] Computer system processes include the allocation of hardware processor time, and the allocation of memory (physical and / or virtual), the allocation of memory for storing instructions executed by the hardware processor, the allocation of memory for storing data generated by the execution of instructions by the hardware processor, and / or the storage of hardware processor state (e.g., register contents) between hardware processor time allocations when the computer system process is not running. Computer system processes run under the control of the operating system and can also run under the control of other programs executing on the computer system.

[0135] cloud computing

[0136] This article generally uses the term "cloud computing" to describe a computing model that enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and facilitates the rapid provisioning and release of resources with minimal management effort or service provider interaction.

[0137] Cloud computing environments (sometimes called cloud environments or the cloud itself) can be implemented in various ways to best suit different requirements. For example, in a public cloud environment, the underlying computing infrastructure is owned by an organization that makes its cloud services available to other organizations or the public. In contrast, private cloud environments are generally used only by a single organization or within a single organization. Community clouds are designed to be shared by several organizations within a community; while hybrid clouds include two or more types of clouds (e.g., private, community, or public) bound together by data and application portability.

[0138] Generally, cloud computing models shift some of the responsibilities that might have previously been provided by an organization's own IT department to be delivered as service layers within the cloud environment for consumer use (depending on the public / private nature of the cloud, within or outside the organization). Depending on the specific implementation, the precise definition of the components or features provided by or within each cloud service layer can vary, but common examples include: Software as a Service (SaaS), where consumers use software applications running on cloud infrastructure, while the SaaS provider manages or controls the underlying cloud infrastructure and applications; Platform as a Service (PaaS), where consumers can use software programming languages ​​and development tools supported by the PaaS provider to develop, deploy, and otherwise control their own applications, while the PaaS provider manages or controls other aspects of the cloud environment (i.e., everything in the runtime execution environment); and Infrastructure as a Service (IaaS), where consumers can deploy and run arbitrary software applications and / or provide processes, storage devices, networks, and other basic computing resources, while the IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS) is a service where consumers use database servers or database management systems running on cloud infrastructure, while the DBaaS provider manages or controls the underlying cloud infrastructure and applications.

[0139] The basic computer hardware and software, as well as the cloud computing environment described above, are provided to illustrate the basic underlying computer components that can be used to implement one or more example embodiments. However, the one or more example embodiments are not necessarily limited to any particular computing environment or computing device configuration. Instead, according to this disclosure, the one or more example embodiments can be implemented in any type of system architecture or processing environment that a person skilled in the art, in view of this disclosure, will understand to be capable of supporting the features and functions of the one or more example embodiments given herein.

[0140] Machine learning models

[0141] A specific machine learning algorithm is used to train the machine learning model. Once trained, the input is applied to the machine learning model to make a prediction, which may also be referred to as the predicate output or output in this paper. The attributes of the input may be called features, and the values ​​of the features may be referred to as feature values ​​in this paper.

[0142] A machine learning model comprises a model data representation or model output. The model output includes parameter values, which may be referred to as theta values ​​in this paper, and is applied to the input by the machine learning algorithm to generate a predicted output. Training a machine learning model requires determining the theta values ​​of the model output. The structure and organization of theta values ​​depend on the machine learning algorithm.

[0143] In supervised training, training data is used by a supervised training algorithm to train a machine learning model. Training data includes inputs and "known" outputs. In this embodiment, the supervised training algorithm is an iterative process. In each iteration, the machine learning algorithm applies the model output and the inputs to generate a predicted output. An objective function is used to calculate the error or variance between the predicted output and the known output. In effect, the output of the objective function indicates the accuracy of the machine learning model based on a specific state of the model output during the iteration. The theta value of the model output can be adjusted by applying an optimization algorithm based on the objective function. An example of an optimization algorithm is gradient descent. The iterations can be repeated until the desired accuracy is achieved or some other criterion is met.

[0144] In a software implementation, when a machine learning model is referred to as receiving input, executing, and / or generating output or predicates, the computer system processing that executes the machine learning algorithm applies the model's output to the input to generate a predicted output. The computer system processing executes the machine learning algorithm by executing software configured to cause the algorithm to execute.

[0145] Machine learning (ML) excels at problems including clustering, classification, regression, anomaly detection, prediction, and dimensionality reduction (i.e., simplification). Examples of machine learning algorithms include decision trees, support vector machines (SVM), Bayesian networks, stochastic algorithms such as genetic algorithms (GA), and connectionist topologies such as artificial neural networks (ANN). Implementations of machine learning can rely on matrices, symbolic models, and hierarchical and / or associative data structures. Parameterized (i.e., configurable) implementations of best-in-class machine learning algorithms can be found in open-source libraries, such as Google's TensorFlow for Python and C++ or Georgia Tech's MLPack for C++. Shogun is an open-source C++ ML library with adapters for several programming languages, including C#, Ruby, Lua, Java, Matlab, R, and Python.

[0146] Artificial Neural Networks

[0147] Artificial neural networks (ANNs) are machine learning models that model high-level systems of neurons interconnected by directed edges. An overview of neural networks is described in the context of hierarchical feedforward neural networks. Other types of neural networks share the characteristics described below.

[0148] In hierarchical feedforward networks such as multilayer perceptrons (MLPs), each layer consists of a set of neurons. Hierarchical neural networks consist of an input layer, an output layer, and one or more intermediate layers called hidden layers.

[0149] Neurons in the input and output layers are referred to as input neurons and output neurons, respectively. Neurons in the hidden or output layers may be referred to as activating neurons in this paper. Activating neurons are associated with activation functions. The input layer does not contain any activating neurons.

[0150] Starting from each neuron in the input and hidden layers, there are one or more directed edges pointing to the activated neurons in subsequent hidden or output layers. Each edge is associated with a weight. The edge from a neuron to the activated neuron represents the input from the neuron to the activated neuron, as adjusted by the weights.

[0151] For a given input to a neural network, each neuron in the network has an activation value. For an input neuron, the activation value is simply the input value of that input. For an activating neuron, the activation value is the output of the corresponding activation function of that neuron.

[0152] Each edge from a specific neuron to an activating neuron represents the activation value of the specific neuron as input to the activating neuron, i.e., input to the activation function of the activating neuron, as adjusted by the edge weights. Therefore, activating neurons in subsequent layers represent the activation values ​​of specific neurons as input to the activation function of the activating neuron, as adjusted by the edge weights. An activating neuron can have multiple edges pointing to it, each edge representing the activation value (as adjusted by the edge weights) from the source neuron as input to the activation function of the activating neuron.

[0153] Each activated neuron is associated with a bias. To generate the activation value of an activated neuron, the neuron's activation function is applied to a weighted set of activation values ​​and biases.

[0154] Illustrative data structures for neural networks

[0155] The output of a neural network can include matrices of weights and biases. Training a neural network iteratively adjusts these weight and bias matrices.

[0156] For hierarchical feedforward networks and other types of neural networks, the output can include one or more matrices of edges W. Matrix W represents the edge from layer L-1 to layer L. Assuming that the number of neurons in layers L-1 and L are N[L-1] and N[L] respectively, then the dimensions of matrix W are N[L-1] columns and N[L] rows.

[0157] The bias of a specific layer L can also be stored in a matrix B with N[L] rows and one column.

[0158] Matrices W and B can be stored in RAM as vectors or arrays, or as comma-separated sets of values. When the product is persistently stored in a persistent storage device, matrices W and B can be stored as comma-separated values ​​in compressed and / or serialized form, or other suitable persistent form.

[0159] The specific inputs applied to a neural network include the value of each input neuron. A specific input can be stored as a vector. Training data includes multiple inputs, each referred to as a sample in the sample set. Each sample includes the value of each input neuron. Samples can be stored as vectors of input values, while multiple samples can be stored as a matrix, where each row of the matrix represents a sample.

[0160] When input is applied to a neural network, activation values ​​are generated for the hidden and output layers. For each layer, the activation values ​​can be stored in a column of matrix A, which has one row for each neuron in the layer. In a vectorized approach used for training, the activation values ​​can be stored in a matrix with one column for each sample in the training data.

[0161] Training a neural network requires storing and processing additional matrices. The optimization algorithm generates a matrix of derivatives used to adjust the weights W and biases B. Generating these derivatives can be done using, and requires storing, a matrix of intermediate values ​​generated during the computation of activation values ​​for each layer.

[0162] The number of neurons and / or edges determines the size of the matrix required to implement a neural network. Fewer neurons and edges in a neural network result in a smaller matrix and less memory required to store it. Furthermore, fewer neurons and edges reduce the computational cost of applying or training the neural network. Fewer neurons mean fewer activation values ​​and / or fewer derivatives to compute during training.

[0163] The properties of the matrix used to implement the neural network correspond to neurons and edges. A cell in matrix W represents a specific edge from layer L-1 to a neuron in layer L. An activated neuron represents the activation function of that layer, including the activation function itself. Activated neurons in layer L correspond to rows in matrix W for the weights of the edges between layers L and L-1, and columns in matrix W for the weights of the edges between layers L and L+1. During the execution of the neural network, neurons also correspond to one or more activation values ​​stored in matrix A for that layer and generated by the activation function.

[0164] ANNs are well-suited for vectorization and data parallelization, leveraging vector hardware such as Single Instruction Multiple Data (SIMD) or GPUs. Matrix partitioning enables horizontal scaling, for example, using Symmetric Multiprocessing (SMP), such as multi-core CPUs and / or multiple coprocessors (such as GPUs). Feedforward computation within an ANN can occur in only one step per neural layer. Activations in a layer are computed based on a weighted propagation of activations from the previous layer, allowing values ​​to be computed sequentially for each subsequent layer, such as through iterations of a for loop. Layering imposes an ordering of computations that are not parallelizable. Therefore, network depth (i.e., the number of layers) can introduce computational latency. Deep learning requires many layers in a Multilayer Perceptron (MLP). Each layer implements data abstraction, and complex (i.e., multidimensional abstractions with several inputs) abstractions require multiple layers to implement cascaded processing. Implementations of ANNs based on reusable matrices and matrix operations for feedforward processing are readily available and parallelizable in neural network libraries such as Google's TensorFlow for Python and C++, OpenNN for C++, and the University of Copenhagen's Fast Artificial Neural Networks (FANN). These libraries also provide model training algorithms, such as backpropagation.

[0165] Backpropagation

[0166] The output of an ANN can be more or less correct. For example, an ANN that recognizes letters might mistake an 'I' for an 'L' because these letters have similar features. The correct output can have one or more specific values, while the actual output can have slightly different values. The arithmetic or geometric difference between the correct and actual outputs can be measured as error according to a loss function, such that zero represents error-free (i.e., perfectly accurate) behavior. For any edge in any layer, the difference between the correct and actual outputs is the incremental value.

[0167] Backpropagation involves distributing the error backward through the layers of an ANN to all connections within the ANN in varying amounts. This error propagation causes adjustments to the edge weights, depending on the gradient of the error at each edge. The gradient of an edge is calculated by multiplying the edge's error increment by the activation value of the upstream neuron. When the gradient is negative, the larger the amount of error the edge contributes to the network, the more its weight should be reduced—this is negative reinforcement. When the gradient is positive, positive reinforcement increases the weight of edges whose activation reduces the error. Edge weights are adjusted as a percentage of the edge's gradient. The steeper the gradient, the greater the adjustment. Not all edge weights are adjusted by the same amount. As the model continues training with additional input samples, the ANN's error should decrease. Training can stop when the error stabilizes (i.e., stops decreasing) or disappears below a threshold (i.e., approaches zero). Christopher M. Bishop teaches example mathematical formulas and techniques for feedforward multilayer perceptrons (MLPs), including matrix operations and backpropagation, in his related reference, “Exact Calculation of the Hessian Matrix for the Multilayer Perceptron”.

[0168] Model training can be supervised or unsupervised. In supervised training, the expected (i.e., correct) output is already known for each example in the training set. The training set is configured in advance by (e.g., by a human expert) assigning a classification label to each example. For example, a training set for optical character recognition could have blurry photographs of individual letters, and an expert could pre-label each photograph based on which letter is displayed. As explained above, error calculation and backpropagation occur.

[0169] Because the desired output needs to be discovered during training, unsupervised model training is involved more extensively. Unsupervised training is easier to implement because it does not require human experts to pre-label training examples. Therefore, unsupervised training saves manpower. A natural way to implement unsupervised training is to utilize an autoencoder, which is a type of ANN. An autoencoder acts as an encoder / decoder with two sets of layers. The first set of layers encodes the input examples into condensed code that needs to be learned during model training. The second set of layers decodes the condensed code to regenerate the original input example. The two sets of layers are trained together as a combined ANN. The error is defined as the difference between the original input and the input regenerated after decoding. After sufficient training, the decoder outputs the original input more or less exactly.

[0170] For each input example, the autoencoder relies on a condensed code as an intermediate format. This intermediate condensed code does not exist initially but emerges only through model training, which may be counterintuitive. Unsupervised training can develop a vocabulary of intermediate codes based on features and distinctions that are unexpectedly relevant. For example, which examples and labels are used during supervised training can depend on a human expert’s somewhat unscientific (e.g., anecdotal) or incomplete understanding of the problem space. Unsupervised training, on the other hand, relies more or less entirely on statistical trends to discover a suitable intermediate vocabulary that reliably converges to optimality with sufficient training due to the internal feedback generated by regenerating the decoder. The implementation and integration techniques of autoencoders are taught in the relevant U.S. patent application No. 14 / 558,700, entitled “AUTO-ENCODER ENHANCED SELF-DIAGNOSTIC COMPONENTS FOR MODEL MONITORING.” This patent application elevates supervised or unsupervised ANN models to the first class of objects suitable for management techniques such as monitoring and governance during model development (e.g., training).

[0171] Random Forest

[0172] Random forests, or random decision forests, are a collective of learning methods that construct a set of randomly generated nodes and decision trees during the training phase. The different decision trees in the forest are constructed by randomly restricting each to a specific subset of the dataset's feature dimensions, such as through feature bootstrapping (bagging). Therefore, as the decision trees grow, they gain accuracy without being forced to overfit the training data, as would happen if the decision trees were forced to learn all feature dimensions of the dataset. Predictions can be computed based on the average (or other integrals, such as softmax) of the predictions from the different decision trees.

[0173] Random forest hyperparameters can include: number of trees in the forest, maximum number of features considered for splitting a node, number of levels in each decision tree, minimum number of data points on a leaf node, method for sampling data points, and so on.

[0174] In the foregoing description, embodiments of the invention have been described with reference to numerous specific details, which may vary from implementation to implementation. Therefore, the description and drawings should be considered illustrative rather than restrictive. The unique and exclusive indication of the scope of the invention, and the content that the applicant intends to define as the scope of the invention, is the literal and equivalent scope of the set of claims published from this application in the specific form of such claims, including any subsequent corrections.

Claims

1. A computer-implemented method, comprising: Repeat the following steps until the dynamic convergence criterion is met: Sampling a subset of values ​​from a database table in a Database Management System (DBMS), and Adjust one or more content statistical estimates of the database table based on the subset of values ​​in the database table; The predicted values ​​predicted by the ML model are used to predict the optimal values ​​of the DBMS query plan configuration settings based on the one or more content statistical estimates of the database tables, wherein the one or more content statistical estimates of the database tables include the estimated cardinality of the columns of the database tables, and wherein the predicted values ​​of the configuration settings are the number of hash intervals or the hash value width. The query plan is executed via DBMS and based on the predicted values ​​set by the configuration to perform queries that access database tables, wherein executing the query plan includes using hash table concatenation data configured to have the hash interval number or the hash value width.

2. The method of claim 1 further includes satisfying the dynamic convergence criterion based on repeatedly predicting the optimal value of the DBMS configuration settings.

3. The method as described in claim 1, wherein, The repeated sampling of a subset of values ​​in a database table occurs in response to selecting at least one from a group consisting of: Preparation of Data Manipulation Language (DML) statements. The query plan begins. The query plan has been completed. The DBMS experiences peak or off-peak demand. Scheduled timer, For the DBMS's archiving or reporting or extraction / translation / loading ETL, The availability of disk space or volatile memory. Table truncation, Index creation, and The database was triggered.

4. The method of claim 1, further comprising: The ML model is trained based on accurate content statistics; The first prediction, based on the exact content statistics obtained through the ML model, is compared with the second prediction, estimated based on the second content statistics obtained through the ML model.

5. The method of claim 1, wherein, The repeated sampling of a subset of values ​​in a database table includes sampling a disjoint subset of rows in the database table.

6. The method of claim 5, wherein, The disjoint subsets of rows include a first subset of rows and a second subset of rows, the first subset of rows and the second subset of rows having a different number of rows.

7. The method of claim 1, wherein, The adjustment of one or more content statistical estimates of the database table includes a user-defined function (UDF), which is calculated from at least one selected from the group consisting of: In the repeated sampling of subsets of values ​​in the database table, the cumulative count of distinct values ​​is performed, and Estimated cardinality of columns in a database table.

8. The method of claim 1, further comprising, based on the UDF satisfying a dynamic convergence criterion, the UDF performing at least one selected from the group consisting of: convergence detection, and calculation of a percentage or absolute change of one of the one or more content statistical estimates of the database table.

9. The method of claim 1, wherein, The DBMS configuration settings include at least one selected from a group consisting of: hash value width, hash interval count, and hash function.

10. The method of claim 1, further comprising satisfying a dynamic convergence criterion based on multiple content statistics.

11. One or more non-transitory computer-readable media storing one or more instruction sequences, which, when executed by one or more processors, cause the execution of the steps of any one of claims 1-10.

12. An apparatus comprising: One or more processors; as well as A memory coupled to the one or more processors and including instructions stored thereon, which, when executed by the one or more processors, cause to perform the steps of any one of claims 1-10.