A method for cardinality estimation based on probabilistic circuits
By employing a probabilistic circuit-based approach, discrete distributed datasets are encoded into integers, dequantized, and standardized. The integral value of the query conditions is then calculated using a probabilistic circuit model. This approach solves the problems of expressive power and tractability in cardinality estimation in existing technologies, achieving efficient and stable cardinality estimation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONG KONG UNIV OF SCI & TECH (GUANGZHOU)
- Filing Date
- 2026-01-12
- Publication Date
- 2026-06-05
Smart Images

Figure CN122152867A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and more specifically to a cardinality estimation method based on probabilistic circuits. Background Technology
[0002] Cardinality estimation is a key problem in the field of databases. Its goal is to predict the number of records in a database that satisfy a specific query condition, and it is an important component of the query optimizer. This problem has been extensively studied and applied in many aspects of database systems, especially in query optimization.
[0003] A high-precision cardinality estimation method can significantly improve the quality of query plans, thereby enhancing overall performance. Traditional methods, such as histograms, sampling, and kernel density estimation, often struggle to capture the correlations between attributes, which presents an opportunity for machine learning-based methods. These methods leverage advanced representation and learning capabilities to achieve higher accuracy.
[0004] Generally, an efficient learning-based cardinality estimation model should meet the following objectives: High accuracy: The estimated cardinality should be as close as possible to the true value to ensure good optimization of the query plan. Good generalization ability: The model should be able to adapt to diverse query loads. Low latency: Since cardinality estimation is called multiple times during query planning, prediction speed is crucial. Lightweight: Memory constraints often require maintaining independent models for multiple data patterns, so efficient loading and use of models is equally important.
[0005] To achieve these goals, researchers have proposed two main approaches: query-driven and data-driven. The former predicts the cardinality of a query by learning a regression mapping from the query to the cardinality, but its generalization performance is poor when the query pattern or underlying data changes. In contrast, the data-driven approach learns the joint distribution of the table data and can generalize better to unseen queries.
[0006] In summary, data-driven machine learning algorithms aim to determine the joint probability density distribution of all table data and transform queries into integrals within corresponding regions to derive the selectivity of the query, thereby obtaining the cardinality. However, such algorithms still face several challenges: On the one hand, Sum-Product Network-based methods can perform integration directly at leaf nodes and derive the required selectivity with only one forward pass, without importance sampling, resulting in high efficiency. However, the accuracy of these methods is limited by the assumption of independence between attributes. On the other hand, deep learning-based methods use deeper models to represent distributions, achieving higher accuracy for point queries. However, these methods require sampling techniques to answer selection queries, increasing latency. The complexity of integral calculations makes these models inefficient in calculating marginal distributions, thus often requiring training on the large table after the join query. Furthermore, these models typically require a large number of parameters, leading to high memory consumption. Overall, data-driven machine learning algorithms involve a trade-off between expressive power and tractability. Methods that can directly perform integration often rely on strong assumptions and lose accuracy, while methods that can more accurately capture data distribution lose tractability in integration, thus reducing efficiency and flexibility. Summary of the Invention
[0007] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide a cardinality estimation method based on probabilistic circuits, which solves the technical problem that existing data-driven machine learning algorithms cannot simultaneously achieve expressive power and processability, and have poor query-driven robustness.
[0008] To achieve the above-mentioned technical objectives, in a first aspect, the present invention provides a cardinality estimation method based on probabilistic circuits, comprising the following steps: Obtain the original discrete distribution dataset, and perform discrete value integer encoding, dequantization, and standardization operations on the discrete distribution dataset to obtain the transformed standardized data, discrete values, and attribute sampling range mapping for each attribute; The probabilistic circuit model is trained using the transformed standardized data to learn the joint distribution of the standardized data, the probabilistic circuit model comprising sequentially connected sum nodes, product nodes and leaf nodes; Obtain the query conditions and convert the query conditions into an integral region in the continuous space mapped by the attribute sampling range; Integrate the integral region at the leaf node, and then perform a forward propagation along the network structure to summarize the result, thereby obtaining the integral value of the model probability density function in the query region. The integral value is the cardinality estimation result.
[0009] Compared with the prior art, the beneficial effects of the present invention include: This application first obtains the original discrete distribution dataset, performs discrete-value integer encoding, dequantization, and standardization operations on the dataset to obtain transformed standardized data, discrete values, and attribute sampling range mappings for each attribute. After dequantization and establishing the attribute sampling range mappings, these mappings are used to encode the query, and the transformed standardized data is used to train the probabilistic circuit model. After obtaining the trained model, it is used to calculate the integral value corresponding to the query. For a given query condition, it is first transformed into an integration region in continuous space according to the data mapping. Since each product node of EiNet is defined on a non-overlapping set of variables, and each summation node satisfies smoothness, the integral can be structurally decomposed recursively.
[0010] In practical calculations, the integral value of the model's probability density function over the query region can be obtained simply by integrating over the specified variable interval at the leaf nodes and summing the results through a forward propagation along the network structure. This means that the estimation process of query selectivity is equivalent to performing a forward computation on the EiNet model, without the need for sampling or numerical approximation, thus achieving accurate and efficient probabilistic inference for complex queries.
[0011] According to some embodiments of the present invention, discrete-value integer encoding of the discrete distribution dataset includes the following steps: Sort all distinct values for each attribute and assign a unique and consecutive integer identifier to each value based on the sorting result.
[0012] According to some embodiments of the present invention, dequantizing the discrete distributed dataset includes the following steps: For each discrete value x after integer encoding, a non-overlapping and seamlessly splicable continuous interval ρ(x) is defined as the mapping range of the discrete value x; For each discrete value x, a sample value is randomly sampled according to the prior distribution within its corresponding sampling interval ρ(x), and the original discrete value x is replaced with the sample value. The corresponding sampling interval mapping is recorded for each attribute.
[0013] According to some embodiments of the present invention, standardizing the discrete distribution dataset includes the following steps: For dequantized data, focus on attributes with a wide range of values and significant differences in magnitude; For all data samples of the target attribute, calculate its mean μ and standard deviation σ respectively; Perform Z-Score transformation, transforming each discrete value x of the target attribute using the formula z=(x-μ) / σ to obtain the transformed standardized data.
[0014] According to some embodiments of the present invention, converting the query conditions into an integral region in a continuous space mapped by the attribute sampling range includes the following steps: For each attribute's query condition, the retrieval interval covers all values. The interval formed by combining the lower limit of the interval corresponding to the minimum value and the upper limit of the interval corresponding to the maximum value is used to obtain the integral range of the attribute's query condition in the learned probability density function. The query representation based on the integral range is the integral region on the learned probability density function Q.
[0015] According to some embodiments of the present invention, the query conditions include: interval selection conditions or equality conditions.
[0016] According to some embodiments of the present invention, the probabilistic circuit of the probabilistic circuit model is an Einstein summation network.
[0017] Secondly, the present invention provides a cardinality estimation system based on probabilistic circuits, which applies the cardinality estimation method based on probabilistic circuits as described in any one of the first aspects, including: The data preprocessing module acquires the original discrete distribution dataset, performs discrete value integer encoding, dequantization, and standardization operations on the discrete distribution dataset, and obtains the transformed standardized data, discrete values, and attribute sampling range mapping corresponding to each attribute. The model training module is communicatively connected to the data preprocessing module. It uses the transformed standardized data to train the probabilistic circuit model to learn the joint distribution of the standardized data. The probabilistic circuit model includes a sum node, a product node, and a leaf node connected in sequence. The query transformation module obtains query conditions and converts the query conditions into an integral region in the continuous space mapped by the attribute sampling range; The probabilistic circuit model is communicatively connected to the query transformation module. It integrates the integral region at the leaf node and performs a forward propagation along the network structure to summarize the result, thereby obtaining the integral value of the model probability density function in the query region. The integral value is the cardinality estimation result.
[0018] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0019] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein the abstract drawings are to be completely consistent with one of the drawings in the specification: Figure 1 A flowchart illustrating a cardinality estimation method based on probabilistic circuits provided in one embodiment of the present invention; Figure 2 A flowchart illustrating the framework of a cardinality estimation method based on probabilistic circuits provided in one embodiment of the present invention; Figure 3 A dequantization flowchart of a cardinality estimation method based on probabilistic circuits provided in an embodiment of the present invention; Figure 4 A probability circuit diagram of a cardinality estimation method based on a probability circuit provided in an embodiment of the present invention; Figure 5 A flowchart illustrating a specific example of a cardinality estimation method based on probabilistic circuits provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0021] It should be noted that although functional modules are divided in the system diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0022] Reference Figures 1 to 5 , Figure 1 A flowchart illustrating a cardinality estimation method based on probabilistic circuits provided in one embodiment of the present invention; Figure 2 A flowchart illustrating the framework of a cardinality estimation method based on probabilistic circuits provided in one embodiment of the present invention; Figure 3 A dequantization flowchart of a cardinality estimation method based on probabilistic circuits provided in an embodiment of the present invention; Figure 4 A probability circuit diagram of a cardinality estimation method based on a probability circuit provided in an embodiment of the present invention; Figure 5 The flowchart illustrates a specific example of a cardinality estimation method based on probabilistic circuits provided in one embodiment of the present invention.
[0023] In one embodiment, the cardinality estimation method based on probabilistic circuits includes the following steps: acquiring the original discrete distribution dataset; performing discrete-value integer encoding, dequantization, and standardization operations on the discrete distribution dataset to obtain the transformed standardized data, discrete values, and attribute sampling range mappings corresponding to each attribute; training the probabilistic circuit model using the transformed standardized data to learn the joint distribution of the standardized data, wherein the probabilistic circuit model includes sequentially connected sum nodes, product nodes, and leaf nodes; acquiring query conditions and converting the query conditions into an integration region in the continuous space of the attribute sampling range mapping; integrating the integration region at the leaf nodes and performing a forward propagation along the network structure to summarize the results, thereby obtaining the integral value of the model probability density function in the query region, which is the cardinality estimation result.
[0024] The discrete-value integer encoding, dequantization, and standardization operations of this invention form a complete data transformation system adapted to continuous probability models. Discrete-value integer encoding first transforms non-integer discrete attributes into continuous integer identifiers. The dequantization operation, through "interval definition + random sampling," smoothly maps discrete data to a continuous space, ensuring the equivalence of the dequantized distribution and the original discrete distribution on the integral, and solving the problem of concentrated probability density in discrete data, making it difficult for continuous models to learn, thus making the data distribution smoother. The standardization operation solves the problem of significant differences in the magnitude of different attributes in real data. After completing dequantization and establishing attribute sampling range mappings, these mappings are used to encode queries, and each query condition is transformed into a range representation of the corresponding attribute in the continuous space. During the training phase, a probabilistic circuit model is used to learn the joint distribution of the table data. The probabilistic circuit formally represents the probability calculation process through a graph structure, consisting of sum nodes (Sum), product nodes (Product), and leaf nodes (Leaf), exhibiting good interpretability and efficient integrability.
[0025] After obtaining the trained model, it is used to calculate the integral value corresponding to the query. Specifically, for a given query condition, it is first transformed into an integration region in continuous space according to the data mapping. Since each product node of EiNet is defined on a non-overlapping set of variables, and each summation node satisfies smoothness, the integral can be structurally decomposed recursively. In actual computation, it is only necessary to integrate over the specified variable interval at the leaf node and summarize the results through a forward propagation along the network structure to obtain the integral value of the model's probability density function over the query region. This means that the estimation process of query selectivity is equivalent to performing a forward computation on the EiNet model, without sampling or numerical approximation, thus achieving accurate and efficient probabilistic inference for complex queries.
[0026] This invention achieves more stable and low-latency queries while ensuring accuracy, and significantly reduces model size.
[0027] The cardinality estimation method based on probabilistic circuits of this invention mainly comprises four parts: Data preprocessing: In real-world data, most attribute values are discrete or encoded as integers. However, mainstream data-driven machine learning methods—whether based on sum-product networks, normalizing flows, or deep neural networks to model conditional probability distributions—are defined in continuous space. Therefore, data dequantization is necessary, which involves smoothly mapping discrete data to a continuous space so that it can be effectively modeled by continuous probability models.
[0028] like Figure 3 As shown, for a simple discrete distribution, without any processing, its probability density will concentrate around a few consecutive points, causing the probability density distribution to experience drastic fluctuations from 0 to a very large value of 1 (let...). (Representing a sufficiently large value). Therefore, a dequantization technique is used to distribute its probability density across the real number domain between the two integer values, i.e., for each discrete value... Randomly sample from a relatively loose neighborhood ρ(x) and replace the sample values with the sample values. In this example, The sampling method is uniform sampling. Simultaneously, a corresponding sampling interval mapping is recorded for each attribute, ensuring that the selectivity of each entry is equivalent to the integral value of the probability density function within that interval.
[0029] Query code: After dequantization and establishing attribute sampling range mappings, these mappings are used to encode the query. Specifically, each query condition (e.g., interval selection or equality condition) is transformed into a range representation of the corresponding attribute in continuous space. For each attribute's query condition, its interval covering all values is retrieved. The interval formed by combining the lower bound of the interval corresponding to the minimum value and the upper bound of the interval corresponding to the maximum value is the integral range of the query condition for that attribute in the learned probability density function. Thus, the query can be represented as the learned probability density function. This is an integral region on the map. In this way, the selectivity calculation of a query is equivalent to the probability integral over the corresponding mapping interval, thus achieving efficient and unified modeling of queries.
[0030] Model training: During the training phase, a probabilistic circuit model is used to learn the joint distribution of the table data. The probabilistic circuit formally represents the probability calculation process through a graph structure, consisting of sum nodes, product nodes, and leaf nodes, exhibiting good interpretability and efficient integrability. Its core properties include: Smoothness: All child nodes of each sum node are defined on the same set of variables, ensuring the consistency of the probability distribution when switching between nodes, thus making the overall model differentiable and optimizable. Decomposability: The child nodes of each product node are defined on non-overlapping sets of variables, enabling the model to achieve efficient probabilistic factorization in its structure. This characteristic guarantees the tractability of marginalization and conditional probability calculations. Thanks to these two properties, the probabilistic circuit has good integrability: the desired probability results can be derived simply by performing the corresponding operations on the leaf nodes. For example, when it is necessary to calculate the integral over a certain region, the integration operation can be completed at the leaf node, and then the results can be aggregated layer by layer through a forward calculation to obtain the accurate integral value of the model probability density function over that integration range.
[0031] To balance high accuracy and processability, a probabilistic circuit implementation, the Einsum Network (EiNet), was adopted.
[0032] Figure 4 Subgraph a shows a typical EiNet unit, consisting of leaf node layers, product node layers, and sum node layers from bottom to top. Each random variable corresponds to two leaf nodes. Observation reveals that each product node satisfies decomposition property because it connects only the leaf nodes corresponding to two distinct random variables; each sum node satisfies smoothness property because each product node it connects corresponds to two jointly distributed random variables. Its structure corresponds to... Figure 4 In subgraph b, the outer product of two vectors (derived from the leaf nodes) is first performed, and then the weighted average of this outer product matrix is repeated twice to obtain the output vector, i.e. This entire process corresponds to Einstein's summation convention. Therefore, Einstein sought a summation. It inherently satisfies both decomposability and smoothness.
[0033] Since Einstein summation can serve as a fundamental building block for probabilistic circuits, EiNet achieves efficient inter-node computation through tensorized Einstein summation, based on probabilistic circuits. Unlike traditional sum-product networks that rely on structure learning, EiNet uses a unified network structure and enhances the expressive flexibility of the structure by repeatedly randomly grouping and mixing the results of the bottom leaf nodes. This design allows EiNet to fully leverage the parallel computing advantages of GPUs in a manner closer to deep learning, thereby significantly improving computational efficiency and model scalability while maintaining analytical integrability.
[0034] integral: After obtaining the trained model, it is used to calculate the integral value corresponding to the query. Specifically, for a given query condition, it is first transformed into an integration region in continuous space according to the data mapping. Since each product node of EiNet is defined on a set of non-overlapping variables, and each summation node satisfies smoothness, the integral can be structurally decomposed recursively.
[0035] In practical calculations, the integral value of the model's probability density function over the query region can be obtained simply by integrating over the specified variable interval at the leaf nodes and summing the results through a forward propagation along the network structure. This means that the estimation process of query selectivity is equivalent to performing a forward computation on the EiNet model, without the need for sampling or numerical approximation, thus achieving accurate and efficient probabilistic inference for complex queries.
[0036] Actual comparison results: Comparative experiments were conducted with traditional algorithms on two different datasets: .
[0037] Experimental results DMV BJAQ As can be seen, the algorithm of this invention successfully achieves more stable and low-latency queries while slightly sacrificing precision, and greatly reduces the model size.
[0038] The discrete value integer encoding of the discrete distribution dataset includes the following steps: sorting all different values of each attribute and assigning a unique and continuous integer identifier to each value according to the sorting result.
[0039] Discrete Encoding: For each attribute, we first sort all its distinct values (DV), and then assign a unique and consecutive integer identifier to each value based on the sorting result. This process is defined as a function. .
[0040] Dequantization of discrete distribution datasets includes the following steps: For each discrete value after integer encoding Define a continuous interval ρ(x) that is non-overlapping and can be seamlessly spliced as the discrete value. The mapping range; For each discrete value Within its corresponding sampling interval ρ(x), sample values are randomly sampled according to the prior distribution, and the original discrete values are replaced with the sample values. For each attribute, a corresponding sampling interval mapping is recorded.
[0041] Dequantization: The sampling range corresponding to each attribute There is no strict optimal standard for the selection method; it is sufficient to ensure that the sampling intervals of different values do not overlap and can be seamlessly spliced into a complete continuous interval. The form is as follows. As for the prior distribution used for sampling, there are no fixed requirements; a uniform distribution is used here.
[0042] Standardizing a discretely distributed dataset includes the following steps: For dequantized data, focus on attributes with a wide range of values and significant differences in magnitude; For all data samples of the target attribute, calculate its mean μ and standard deviation σ respectively; Perform Z-Score transformation for each discrete value of the target attribute. The standardized data is obtained by converting the data using the formula z = (x-μ) / σ.
[0043] Standardization: In some cases, the range of real-world data values can be extremely large, with differences in magnitude reaching tens or even hundreds of millions. This significantly increases the difficulty of model training, necessitating data standardization. In this embodiment, the Z-Score standardization method is employed to ensure that each attribute has a similar scale during training, thereby improving the model's convergence stability and training performance.
[0044] The process of converting query conditions into an integral region in the continuous space mapped by the attribute sampling range includes the following steps: For each attribute query condition, the retrieval interval covers all values, and the interval formed by combining the lower limit of the interval corresponding to the minimum value and the upper limit of the interval corresponding to the maximum value is used to obtain the integral range of the attribute query condition in the learned probability density function. The query based on the integral range is represented as the integral region on the learned probability density function Q.
[0045] In one embodiment, the cardinality estimation system based on probabilistic circuits includes: a data preprocessing module, which acquires the original discrete distribution dataset, performs discrete-value integer encoding, dequantization, and standardization operations on the discrete distribution dataset to obtain transformed standardized data, discrete values, and attribute sampling range mappings corresponding to each attribute; a model training module, which is communicatively connected to the data preprocessing module, trains the probabilistic circuit model using the transformed standardized data to learn the joint distribution of the standardized data, the probabilistic circuit model including sequentially connected sum nodes, product nodes, and leaf nodes; a query transformation module, which acquires query conditions and transforms the query conditions into an integral region in the continuous space of the attribute sampling range mapping; and a probabilistic circuit model, which is communicatively connected to the query transformation module, integrates the integral region at the leaf nodes, and performs a forward propagation along the network structure to summarize the results, obtaining the integral value of the model probability density function in the query region, the integral value being the cardinality estimation result.
[0046] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
[0047] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A cardinality estimation method based on probabilistic circuits, characterized in that, Including the following steps: Obtain the original discrete distribution dataset, and perform discrete value integer encoding, dequantization, and standardization operations on the discrete distribution dataset to obtain the transformed standardized data, discrete values, and attribute sampling range mapping for each attribute; The probabilistic circuit model is trained using the transformed standardized data to learn the joint distribution of the standardized data, the probabilistic circuit model comprising sequentially connected sum nodes, product nodes and leaf nodes; Obtain the query conditions and convert the query conditions into an integral region in the continuous space mapped by the attribute sampling range; Integrate the integral region at the leaf node, and then perform a forward propagation along the network structure to summarize the result, thereby obtaining the integral value of the model probability density function in the query region. The integral value is the cardinality estimation result.
2. The cardinality estimation method based on probabilistic circuits according to claim 1, characterized in that, The discrete-value integer encoding of the discrete-distribution dataset includes the following steps: Sort all distinct values for each attribute and assign a unique and consecutive integer identifier to each value based on the sorting result.
3. The cardinality estimation method based on probabilistic circuits according to claim 2, characterized in that, Dequantizing the discrete distributed dataset includes the following steps: For each discrete value x after integer encoding, a non-overlapping and seamlessly splicable continuous interval ρ(x) is defined as the mapping range of the discrete value x; For each discrete value x, a sample value is randomly sampled according to the prior distribution within its corresponding sampling interval ρ(x), and the original discrete value x is replaced with the sample value. The corresponding sampling interval mapping is recorded for each attribute.
4. The cardinality estimation method based on probabilistic circuits according to claim 3, characterized in that, Standardizing the discrete distributed dataset includes the following steps: For dequantized data, focus on attributes with a wide range of values and significant differences in magnitude; For all data samples of the target attribute, calculate its mean μ and standard deviation σ respectively; Perform a Z-Score transformation, and for each discrete value x of the target attribute, use the formula... The z=(x-μ) / σ conversion yields the standardized data.
5. The cardinality estimation method based on probabilistic circuits according to claim 1, characterized in that, Converting the query conditions into an integral region in the continuous space mapped by the attribute sampling range includes the following steps: For each attribute's query condition, the retrieval interval covers all values. The interval formed by combining the lower limit of the interval corresponding to the minimum value and the upper limit of the interval corresponding to the maximum value is used to obtain the integral range of the attribute's query condition in the learned probability density function. The query representation based on the integral range is the integral region on the learned probability density function Q.
6. The cardinality estimation method based on probabilistic circuits according to claim 1, characterized in that, The query conditions include: range selection conditions or equality conditions.
7. The cardinality estimation method based on probabilistic circuits according to claim 1, characterized in that, The probabilistic circuit model described above uses an Einstein summation network.
8. A cardinality estimation system based on probabilistic circuits, employing the cardinality estimation method based on probabilistic circuits as described in any one of claims 1-7, characterized in that, include: The data preprocessing module acquires the original discrete distribution dataset, performs discrete value integer encoding, dequantization, and standardization operations on the discrete distribution dataset, and obtains the transformed standardized data, discrete values, and attribute sampling range mappings corresponding to each attribute. The model training module is communicatively connected to the data preprocessing module. It uses the converted standardized data to train the probabilistic circuit model to learn the joint distribution of the standardized data. The probabilistic circuit model includes a sum node, a product node, and a leaf node connected in sequence. The query transformation module obtains query conditions and converts the query conditions into an integral region in the continuous space mapped by the attribute sampling range; The probabilistic circuit model is communicatively connected to the query transformation module. It integrates the integral region at the leaf node and performs a forward propagation along the network structure to summarize the result, thereby obtaining the integral value of the model probability density function in the query region. The integral value is the cardinality estimation result.