Method and apparatus for dynamically associating different query execution strategies with selective portions of a database table
First Claim
1. A method for executing a database query in a computer system, comprising the computer-executed steps of:
- automatically determining whether multiple separate query execution strategies should be used for evaluating said database query against different respective discrete subsets of a database table; and
responsive to determining that multiple separate query execution strategies should be used for evaluating said database query against different respective discrete subsets of a database table, automatically generating multiple separate query execution strategies for evaluating said database query against said different respective discrete subsets of said database table, and automatically generating a union of a respective results set of each said separate query execution strategy.
1 Assignment
0 Petitions
Accused Products
Abstract
A query facility for database queries dynamically determines whether selective portions of a database table are likely to benefit from separate query execution strategies, and constructs an appropriate separate execution strategies accordingly. Preferably, the database contains at least one relatively large table comprising multiple partitions, each sharing the definitional structure of the table and containing a different respective discrete subset of the table records. The query facility compares metadata for different partitions to determine whether sufficiently large differences exist among the partitions, and in appropriate cases selects one or more partitions for separate execution strategies. Preferably, partitions are ranked for separate evaluation using a weighting formula which takes into account: (a) the number of indexes for the partition, (b) recency of change activity, and (c) the size of the partition.
-
Citations
20 Claims
-
1. A method for executing a database query in a computer system, comprising the computer-executed steps of:
-
automatically determining whether multiple separate query execution strategies should be used for evaluating said database query against different respective discrete subsets of a database table; and
responsive to determining that multiple separate query execution strategies should be used for evaluating said database query against different respective discrete subsets of a database table, automatically generating multiple separate query execution strategies for evaluating said database query against said different respective discrete subsets of said database table, and automatically generating a union of a respective results set of each said separate query execution strategy. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A computer program product for database query optimization comprising:
-
a plurality of computer-executable instructions recorded on signal-bearing media, wherein said instructions, when executed by at least one computer system, cause the at least one computer system to perform the steps of;
receiving a database query against information in a database table having multiple partitions;
determining whether multiple separate query execution strategies should be used for evaluating said database query against different respective partitions of said database table; and
responsive to determining that multiple separate query execution strategies should be used for evaluating said database query against different respective partitions of said database table, generating multiple separate query execution strategies for evaluating said database query against said different respective partitions of said database table, and generating a union of a respective results set of each said separate query execution strategy. - View Dependent Claims (12, 13, 14)
-
-
15. A computer system, comprising:
-
at least one processor;
a data storage for storing a database, said database containing a partitioned database table having a plurality of partitions;
a database management facility embodied as a plurality of instructions executable on said at least one processor, said database management facility including a query engine which executes logical queries against said database including logical queries against said partitioned database table and a query optimizer for generating execution strategies for executing logical queries against said database;
wherein said database management facility automatically determines, with respect to each of a plurality of said logical queries against said partitioned database table, whether multiple separate query execution strategies should be used for evaluating the respective said logical query against said partitioned database table; and
wherein, responsive to determining that multiple separate query execution strategies should be used for evaluating a respective logical query against said partitioned database table, said database management facility automatically generates multiple separate query execution strategies for evaluating the respective logical query, each of said multiple separate query execution strategies being used for evaluating the respective logical query against a different respective discrete non-empty set of partitions of said partitioned database table, and automatically generates a union of a respective results set of each said separate query execution strategy. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification