System and method for query optimization using quantile values of a large unordered data set
First Claim
Patent Images
1. A data storage system, comprising:
- a computer;
one or more input devices electrically connected to the computer for generating a user request for data satisfying a predetermined condition;
a database accessible by the computer for holding a set of data records; and
a database management system executable by the computer, the database management system including a compiler, the compiler including;
a query optimizer for generating a query plan in response to quantiles of the set of data records;
comparator means in the query optimizer for sequentially comparing the data records in the set of data records to a test value of the condition in a single pass over the set of data records;
means for selectively inserting a data record in a test set having a cardinality less than the cardinality of the set of data records based upon the comparison and the condition; and
means for accessing the test set to generate a quantile value in response to a data record in the test set, the quantile value representative of a number of data records in the database satisfying the condition.
1 Assignment
0 Petitions
Accused Products
Abstract
A database management system determines, in a single pass over an unordered database, the quantile information. The system sequentially compares each tuple in the data set to a test value, and then selectively inserts the tuple in a test set having a cardinality less than the cardinality of the data set based upon the comparison. The system next uses the quantile information to estimate the number of tuples in the database which satisfy a user-defined predicate to generate an efficient query plan.
-
Citations
12 Claims
-
1. A data storage system, comprising:
-
a computer; one or more input devices electrically connected to the computer for generating a user request for data satisfying a predetermined condition; a database accessible by the computer for holding a set of data records; and a database management system executable by the computer, the database management system including a compiler, the compiler including; a query optimizer for generating a query plan in response to quantiles of the set of data records; comparator means in the query optimizer for sequentially comparing the data records in the set of data records to a test value of the condition in a single pass over the set of data records; means for selectively inserting a data record in a test set having a cardinality less than the cardinality of the set of data records based upon the comparison and the condition; and means for accessing the test set to generate a quantile value in response to a data record in the test set, the quantile value representative of a number of data records in the database satisfying the condition. - View Dependent Claims (2, 3, 4)
-
-
5. A method executed by a query optimizer for estimating a number of records containing a data field satisfying a predetermined query condition in a data set having a data set cardinality in a single pass over the records of the set, comprising the steps of:
-
generating a test set having a cardinality less than the data set cardinality; sequentially comparing each record in the data set to a test value and generating a first value in response thereto; generating a second value representative of the condition; selectively inserting the record in the test set in response to the first and second values; determining in said single pass and from a record in the test set a quantile value representing a number of records in the data set which satisfy the condition; and generating a query plan in response to the quantile value. - View Dependent Claims (6, 7, 8)
-
-
9. An optimizer including a quantile engine for estimating a number of tuples satisfying a condition in a set of tuples having a cardinality in a single pass over the tuples of the set, the quantile engine characterized by:
-
comparator means for sequentially comparing all tuples in the set of tuples to a test value; means for selectively inserting a tuple in the set of tuples in a test set having a cardinality less than the cardinality of the set of tuples based upon the comparison and the condition; and means for generating in said single pass a quantile value representative of the number of tuples of the test set satisfying the condition. - View Dependent Claims (10, 11, 12)
-
Specification