Method for index tuning of a SQL statement, and index merging for a multi-statement SQL workload, using a cost-based relational query optimizer
First Claim
Patent Images
1. A method comprising:
- identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements;
for each statement in the set,performing an optimization process on the statement;
determining an access structure for an advanced transformation of the statement;
during the optimization process, generating a set of candidate indexes which could be used to improve an execution plan for the statement, wherein the set of candidate indexes comprises index candidates for the access structure;
selecting a subset from the set of candidate indexes based at least in part on a determination of whether an index maintenance cost exceeds a non-zero threshold or not;
identifying an index in the subset that can satisfy a different statement;
consolidating the identified index in the subset with an index for the different statement;
determining an execution plan using a processor for the statement using the subset of indexes; and
storing the execution plan in a medium.
1 Assignment
0 Petitions
Accused Products
Abstract
An access structure analysis method is interspersed with the query optimization process. The method can determine the ideal combination of access structures, including both materialized views and indexes, for a given database workload. The interspersed structure analysis method can include advanced transformations like view merging, star transformation, bitmap access plans, query rewrite using materialized views, for example. The method may be performed using the query optimizer'"'"'s rules as heuristics to guide the index candidate generation process.
151 Citations
27 Claims
-
1. A method comprising:
-
identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements; for each statement in the set, performing an optimization process on the statement; determining an access structure for an advanced transformation of the statement; during the optimization process, generating a set of candidate indexes which could be used to improve an execution plan for the statement, wherein the set of candidate indexes comprises index candidates for the access structure; selecting a subset from the set of candidate indexes based at least in part on a determination of whether an index maintenance cost exceeds a non-zero threshold or not; identifying an index in the subset that can satisfy a different statement; consolidating the identified index in the subset with an index for the different statement; determining an execution plan using a processor for the statement using the subset of indexes; and storing the execution plan in a medium. - View Dependent Claims (2, 3, 4, 5, 6, 22, 23)
-
-
7. A computer-implemented system comprising:
-
means for identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements; means for performing an optimization process on a first statement in the set; means for determining an access structure for an advanced transformation of the statement; means for generating, during the optimization process, a set of candidate indexes which could be used to improve an execution plan for the first statement, wherein the set of candidate indexes comprises index candidates for the access structure; means for selecting a subset from the set of candidate indexes based at least in part on a determination of whether an index maintenance cost exceeds a non-zero threshold or not; means for identifying an index in the subset that can satisfy a second statement in the set; means for consolidating the identified index in the subset with an index for the second statement; and means for determining an execution plan for the first statement using the subset of indexes, wherein the means for determining the execution plan comprises a processor. - View Dependent Claims (8, 9, 10, 11, 12, 24, 25)
-
-
13. A volatile or non-volatile computer readable medium storing a computer program of instructions which, when executed by a processing system, cause the system to perform a method comprising:
-
identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements; for each statement in the set, performing an optimization process on the statement; determining an access structure for an advanced transformation of the statement; during the optimization process, generating a set of candidate indexes which could be used to improve an execution plan for the statement, wherein the set of candidate indexes comprises index candidates for the access structure; selecting a subset from the set of candidate indexes based at least in part on a determination of whether an index maintenance cost exceeds a non-zero threshold or not; identifying an index in the subset that can satisfy a different statement; consolidating the identified index in the subset with an index for the different statement; and determining an execution plan for the statement using the subset of indexes. - View Dependent Claims (14, 15, 16, 17, 18, 26, 27)
-
-
19. A method comprising:
-
identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements; for each statement in the set, performing an optimization process on the statement; determining that an access structure for an advanced transformation of the statement is beneficial for the statement during the optimization process; during the optimization process, generating a set of candidate indexes which could be used to improve an execution plan for the statement, wherein the set of candidate indexes comprises index candidates for the access structure; selecting a subset from the set of candidate indexes using a model to remove expensive indexes;
identifying an index in the subset that can satisfy a different statement;consolidating the identified index in the subset with an index for the different statement; determining an execution plan using a processor for the statement using the subset of indexes; and storing the execution plan in a medium.
-
-
20. A computer-implemented system comprising:
-
means for identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statements; means for performing an optimization process on a first statement in the set;
means for determining that an access structure for an advanced transformation of the statement is beneficial for the statement during the optimization process;
means for generating, during the optimization process, a set of candidate indexes which could be used to improve an execution plan for the first statement, wherein the set of candidate indexes comprises index candidates for the access structure;means for selecting a subset from the set of candidate indexes using a model to remove expensive indexes; means for identifying an index in the subset that can satisfy a second statement in the set; means for consolidating the identified index in the subset with an index for the second statement; and means for determining an execution plan for the first statement using the subset of indexes, wherein the means for determining the execution plan comprises a processor.
-
-
21. A volatile or non-volatile computer readable medium storing a computer program of instructions which, when executed by a processing system, cause the system to perform a method comprising:
-
identifying a set of high load database query language statements from a workload by performing a comparison between performance information for query language statements in the workload, wherein the workload comprises query language statement; for each statement in the set, performing an optimization of the statement; determining that an access structure for an advanced transformation of the statement is beneficial for the statement during the optimization process; during the optimization process, generating a set of candidate indexes which could be used to improve an execution plan for the statement, wherein the set of candidate indexes comprises index candidates for the access structure; selecting a subset from the set of candidate indexes using a model to remove expensive indexes; identifying an index in the subset can satisfy a different statement; consolidating the identified index in the subset with an index for the different statement; and determining an execution plan for the statement using the subset of indexes.
-
Specification