System and method for automatically generating database queries
AssigneeComputer Associates Think, Inc.
InventorsEdward Kosciusko, Sreekumar Menon, Hung-Vuong Vo, John K. Vincent, Thomas K. Werling, Joyce H. Lau
Life of this patent
Estimating the term…
Abstract
A method of tuning a database query includes selecting a database query, parsing the selected database query to determine relationships between portions of the selected database query, selecting an optimization mode from a plurality of available optimization modes, tuning the selected database query by modifying, at least one portion of the selected database query based on the determined relationships and the selected optimization mode and displaying the modified database query.
Claims38
A method of tuning a database query, comprising:
- allowing a user to select a query of a database;
- parsing the selected database query to determine that the database query includes a first operator;
- selecting an optimization mode from a plurality of available optimization modes, wherein:
- a first optimization mode is automatically selected if one or more statistics exist for a table identified by the database query, and
- a second optimization mode is selected if one or more statistics do not exist for the table identified by the database query;
- tuning automatically the selected database query based on the structure of the database and the selected optimization mode;
- and
- displaying the tuned database query, and
- wherein automatically tuning the selected database query comprises automatically rewriting the selected database query by converting the first operator to a second operator.
A computer storage medium including computer executable code for tuning a database query, comprising:
- computer executable code for allowing a user to select a query of a database;
- computer executable code for parsing the selected database query to determine that the database query includes a first operator;
- computer executable code for selecting an optimization mode from a plurality of available optimization modes, wherein:
- a first optimization mode is automatically selected if one or more statistics exist for a table identified by the database query, and
- a second optimization mode is selected if one or more statistics do not exist for the table identified by the database query;
- computer executable code for automatically tuning the selected database query based on the structure of the database and the selected optimization mode;
- and
- computer executable code for displaying the tuned database query, and
- wherein the computer executable code for automatically tuning the selected database query comprises computer executable code for automatically rewriting the selected database query by converting the first operator to a second operator.
A programmed computer system for tuning a database query, comprising:
- a display for displaying at least one of a plurality of database queries of a database to a user;
- a user input allowing the user to select a database query from among the displayed database queries;
- and
- a processor for parsing the selected database query to determine that the database query includes a first operator and for automatically tuning the selected database query based on the structure of the database, the tuned database query being displayed to the user via the display, wherein automatically tuning the selected database query comprises:
- automatically selecting a first optimization mode if one or more statistics exist for a table identified by the database query, and
- selecting a second optimization mode is selected if one or more statistics do not exist for the table identified by the database query, and
- wherein automatically tuning the selected database query comprises automatically rewriting the selected database query by converting the first operator to a second operator.
A method of tuning a database query, comprising:
- allowing a user to select a query of a database;
- parsing the selected database query to determine that the database query includes a first operator;
- selecting an optimization mode from a plurality of available optimization modes;
- tuning automatically the selected database query based on the structure of the database and the selected optimization mode;
- and
- displaying the tuned database query,
- wherein automatically tuning the selected database query comprises automatically rewriting the selected database query by converting the first operator to a second operator, and
- wherein selecting the optimization mode from the plurality of available optimization modes comprises:
- determining whether one or more statistics exist for a table identified by the query;
- automatically selecting a first optimization mode if the one or more statistics exist for the table;
- and
- automatically selecting a second optimization mode if the one or more statistics do not exist for the table.
A method of tuning a database query, comprising:
- allowing a user to select a query of a database;
- parsing the selected database query to determine that the database query includes a first operator;
- selecting an optimization mode from a plurality of available optimization modes;
- tuning automatically the selected database query based on the structure of the database and the selected optimization mode;
- and
- displaying the tuned database query,
- wherein automatically tuning the selected database query comprises automatically rewriting the selected database query by converting the first operator to a second operator, and
- wherein selecting the optimization mode from the plurality of available optimization modes comprises:
- determining whether one or more statistics exist for a table identified by the query;
- automatically selecting a first optimization mode if the one or more statistics exist for the table;
- and
- receiving user preferences for selecting a second optimization mode if the one or more statistics do not exist for the table.
Dependencies are inferred from the claim text.