Access path selection for SQL with variables in a RDBMS
First Claim
1. A method of executing a query in a computer, the query being performed by the computer to retrieve data from a database stored on a data storage device connected to the computer, the method comprising the steps of:
- receiving the query containing at least one variable;
determining an access path for the query during a bind process based on a default filter factor; and
at execution time optimizing the access path by, determining a value for each variable in the query;
generating an optimal filter factor using the determined value for each variable; and
generating a new access path for the query using the optimal filter factor, while disregarding any previously generated access path based on the default filter factor.
0 Assignments
0 Petitions
Accused Products
Abstract
A method, apparatus, and article of manufacture for a computer implemented query compiler. A query is executed in a computer, the query being performed by the computer to retrieve data from a database stored on a data storage device connected to the computer. The query is received containing at least one variable. At execution time, a value is determined for each variable in the query. A filter factor is estimated using the determined value for each variable. Then, an access path is determined for the query using the estimated filter factor.
110 Citations
12 Claims
-
1. A method of executing a query in a computer, the query being performed by the computer to retrieve data from a database stored on a data storage device connected to the computer, the method comprising the steps of:
-
receiving the query containing at least one variable;
determining an access path for the query during a bind process based on a default filter factor; and
at execution time optimizing the access path by, determining a value for each variable in the query;
generating an optimal filter factor using the determined value for each variable; and
generating a new access path for the query using the optimal filter factor, while disregarding any previously generated access path based on the default filter factor.
-
-
2. A method of executing a query in a computer, the query being performed by the computer to retrieve data from a database stored on a data storage device connected to the computer, the method comprising the steps of:
generating an optimal access path for the query after initial compilation and during the execution using an actual value for each variable in the query to estimate a filter factor, while disregarding any previously generated access path based on a default filter factor selected prior to determining the actual value for each variable in the query. - View Dependent Claims (3, 4)
-
5. An apparatus for executing a query, comprising:
a computer having a data storage device connected thereto, wherein the data storage device stores a database;
one or more computer programs, performed by the computer, for receiving the query containing at least one variable, determining an access path for the query during a bind process based on a default filter factor, and at execution time, optimizing the access path by determining a value for each variable in the query, generating a new optimal filter factor using the determined value for each variable, and generating a new access path for the query using the optimal filter factor, while disregarding any previously generated access path based on the default filter factor.
-
6. An apparatus for executing a query, comprising:
-
a computer having a data storage device connected thereto, wherein the data storage device stores a database;
one or more computer programs, performed by the computer, for generating an optimal access path for the query after initial compilation and during the execution using an actual value for each variable in the query to estimate a filter factor, while disregarding any previously generated access path based on a default filter factor selected prior to determining the actual value for each variable in the query. - View Dependent Claims (7, 8)
-
-
9. An article of manufacture comprising a computer program carrier readable by a computer and embodying one or more instructions executable by the computer to perform method steps for executing a query, the query being performed by the computer to retrieve data from a database stored in a data storage device connected to the computer, the method comprising the steps of:
-
receiving the query containing at least one variable; and
determining an access path for the query during a bind process based on a default filter factor; and
at execution time optimizing the access path by, determining a value for each variable in the query;
generating an optimal filter factor using the determined value for each variable; and
generating a new access path for the query using the estimated filter factor, while disregarding any previously generated access path.
-
-
10. An article of manufacture comprising a computer program carrier readable by a computer and embodying one or more instructions executable by the computer to perform method steps for executing a query, the query being performed by the computer to retrieve data from a data base stored in a data storage device connected to the computer, the method comprising the step of:
generating an optimal access path for the query after initial compilation and during the execution using an actual value for each variable in the query to estimate a filter factor, while disregarding any previously generated access path based on a default filter factor selected prior to determining the actual value for each variable in the query. - View Dependent Claims (11, 12)
Specification