Estimating a number of rows returned by a recursive query
First Claim
1. A method comprising:
- receiving a recursive query, wherein the recursive query comprises a recursive predicate associated with a recursive column in a table; and
estimating a number of rows that the recursive query will retrieve, wherein the estimating further comprises recursively probing an index associated with the table.
1 Assignment
0 Petitions
Accused Products
Abstract
A method, apparatus, system, and signal-bearing medium that, in an embodiment, estimate a number of rows that a recursive query will retrieve from a table by recursively probing an index associated with the table. A recursive query includes a seed and a recursive predicate, each of which is associated with a respective column in the table. If the index has a leading column that matches the table column associated with the seed, and the index has a secondary column that matches the table column associated with the recursive predicate, then the index is recursively probed until a threshold depth of the recursive probing is reached or until all nodes of the index have been examined. The estimated number of rows that the recursive query will retrieve is then calculated based on either the number of rows examined in the index (if the threshold depth has not been reached) or based on the threshold depth, a cardinality of the secondary column, and a cardinality of the primary column (if the threshold depth has been reached). If the index does not have a leading column that matches the table column associated with the seed, an index is found that has a recursive and non-recursive columns that match columns that are compared by the recursive predicate. The minimum value of the leading column is then used to start recursively probing up the index, and the estimated number of rows is calculated based on the maximum depth (or average depth in another embodiment) of the recursion, a cardinality of the recursive column, and a cardinality of the non-recursive column.
32 Citations
24 Claims
-
1. A method comprising:
-
receiving a recursive query, wherein the recursive query comprises a recursive predicate associated with a recursive column in a table; and
estimating a number of rows that the recursive query will retrieve, wherein the estimating further comprises recursively probing an index associated with the table. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A signal-bearing medium encoded with instructions, wherein the instructions when executed comprise:
-
receiving a recursive query, wherein the recursive query comprises a recursive predicate associated with a recursive column in a table; and
estimating a number of rows that the recursive query will retrieve, wherein the estimating further comprises recursively probing an index associated with the table. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A method for configuring a computer, comprising:
-
configuring the computer to receive a recursive query, wherein the recursive query comprises a recursive predicate associated with a recursive column in a table; and
configuring the computer to estimate a number of rows that the recursive query will retrieve, wherein the configuring the computer to estimate further comprises configuring the computer to recursively probe an index associated with the table. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
-
Specification