Estimating query cardinality
AssigneeTechnion Research & Development Foundation Limited
InventorsOded Shmueli, Rojeh Hayek
Life of this patent
Estimating the term…
Abstract
A method comprising: receiving a plurality of pairs of queries associated with a database, wherein the queries in each pair in the plurality of pairs of queries have an identical FROM clause; at a training stage, training a machine learning model on a training set comprising: (i) the plurality of pairs of queries, and (ii) labels associated with containment rates between each of the pairs of queries over the database; and at an inference stage, applying the trained machine learning model to a pair of target queries, to estimate containment rates between the target pair of queries over the database.
Claims17
A method comprising:
- receiving a pair of target queries associated with a database, having an identical FROM clause;
- applying a trained machine learning (ML) model to the pair of target queries, to estimate a containment rate, representing a percentage of rows in an execution result of a first query of the target pair of queries, that are also included in an execution result of the second query of the target pair of queries, over said database.
A method comprising:
- receiving a target query;
- forming an intersection query of said target query and a provided query, wherein said intersection query has a FROM clause identical to that of said target query and said provided query;
- applying a cardinality estimation model to said target query and said intersection query, to determine cardinality values of each of said target query and intersection query over a database;
- and
- estimating a containment rate, representing a percentage of rows in an execution result of said target query over said database that are also included in an execution result of said provided query over said database, based on said cardinality values of said target query and said intersection query.
A method comprising:
- providing a set of queries over a database;
- receiving a target query having a specified FROM clause;
- selecting, from said set of queries, a query having a FROM clause identical to said specified FROM clause;
- providing a cardinality value of said selected query;
- applying a containment rate estimation model to estimate (i) a containment rate of said selected query in said target query over said database, and (ii) a containment rate of said target query in said selected query over said database;
- and
- determining a cardinality value of said target query over said database, based on (i), (ii), and said provided cardinality value of said selected query.
A method comprising
- receiving a plurality of queries associated with a database;
- at a training stage, training a machine learning model on a training set comprising:
- (i) said plurality of queries, and
- (ii) labels associated with a uniqueness rate of each of said queries over said database;
- and
- at an inference stage, applying said trained machine learning model to a target query to estimate a uniqueness rate, representing a percentage of rows that are unique in an execution result of said target query over said database.
Dependencies are inferred from the claim text.