Generating statistics for temporary tables during query optimization
First Claim
Patent Images
1. A method of optimizing a database query, the method comprising:
- receiving a first database query where at least one field is materialized into a first temporary table during execution of the first database query, wherein the field is associated with a second database query;
merging at least one predicate from the first database query with at least one predicate from the second database query;
generating a first statistic for the first temporary table prior to creation of the first temporary table based upon the merged predicates from the first and second database queries, wherein the first statistic includes a cardinality for at least one column of the first temporary table; and
optimizing the first database query using the first statistic.
2 Assignments
0 Petitions
Accused Products
Abstract
A method generates at least one statistic for a temporary table during optimization of a database query before the temporary table is created. By doing so, optimization can proceed on a database query irrespective of the fact that the temporary table may not be materialized until the database query is ultimately executed.
-
Citations
9 Claims
-
1. A method of optimizing a database query, the method comprising:
-
receiving a first database query where at least one field is materialized into a first temporary table during execution of the first database query, wherein the field is associated with a second database query; merging at least one predicate from the first database query with at least one predicate from the second database query; generating a first statistic for the first temporary table prior to creation of the first temporary table based upon the merged predicates from the first and second database queries, wherein the first statistic includes a cardinality for at least one column of the first temporary table; and optimizing the first database query using the first statistic. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
Specification