Automated database query tuning
Assigneesalesforce.com, inc.
InventorsAwais Tariq, Rohitashva Mathur, Arup Dutta, Prem Veeramani, Jesse Collins
Life of this patent
Estimating the term…
Abstract
Automated query tuning. A database query to be executed against a database is received. The database query is analyzed to determine one or more potential indexes to be evaluated. The one or more potential indexes are evaluated to determine if an optimization utilizing a selected potential index provides improved performance over performing the database query without the selected potential index. The one or more potential indexes are scored based on results of the evaluating. A recommendation of one or more of the potential indexes is provided to a source of the database query.
Claims18
A method comprising:
- receiving, with a computing platform having one or more processors coupled with at least one physical memory device, a database query to be executed on the computing platform against a database;
- analyzing the database query with at least a tuning query recommendation engine provided at least by the one or more processors to determine one or more potential indexes to be evaluated, wherein the one or more potential indexes comprise a set of custom indexes and native skinny indexes that could be built on columns that are filtered or sorted on in the query;
- evaluating, with the tuning query recommendation engine, the one or more potential indexes to determine if an optimization utilizing a selected potential index provides improved performance over performing the database query without the selected potential index by performing, for each potential index, an evaluation with sampled pre-queries to estimate selectivity of the corresponding potential index;
- scoring the one or more potential indexes based on results of the evaluating with the tuning query recommendation engine;
- providing, with the tuning query recommendation engine, a recommendation of one or more of the potential indexes to a source of the database query via a query plan user interface configured to receive user input, wherein the user interface provides at least a cardinality and a table size for the tables to which recommendations correspond and one or more recommended potential indexes that would perform better than an existing best option based on existing indexes, wherein the user interface further provides indications of which tables various recommendations can be applied and indications of which fields to which various recommendations can be applied;
- and
- building, with the tuning query recommendation engine, at least one of the one or more potential indexes in response to a received indication.
A non-transitory computer-readable medium having stored thereon instructions that, when executed by one or more processors, are configurable to cause the one or more processors to:
- receive a database query to be executed on the computing platform against a database;
- analyze the database query with at least a tuning query recommendation engine provided at least by the one or more processors to determine one or more potential indexes to be evaluated, wherein the one or more potential indexes comprise a set of custom indexes and native skinny indexes that could be built on columns that are filtered or sorted on in the query;
- evaluate, with the tuning query recommendation engine, the one or more potential indexes to determine if an optimization utilizing a selected potential index provides improved performance over performing the database query without the selected potential index by performing, for each potential index, an evaluation with sampled pre-queries to estimate selectivity of the corresponding potential index;
- score the one or more potential indexes based on results of the evaluating with the tuning query recommendation engine;
- provide, with the tuning query recommendation engine, a recommendation of one or more of the potential indexes to a source of the database query via a query plan user interface configured to receive user input, wherein the user interface provides at least a cardinality and a table size for the tables to which recommendations correspond and one or more recommended potential indexes that would perform better than an existing best option based on existing indexes, wherein the user interface further provides indications of which tables various recommendations can be applied and indications of which fields to which various recommendations can be applied;
- and
- build, with the tuning query recommendation engine, at least one of the one or more potential indexes in response to a received indication.
A system comprising:
- at least one memory device;
- one or more processors coupled with the at least one memory device, the one or more processors to execute code configurable to receive a database query to be executed on the computing platform against a database, to analyze the database query with at least a tuning query recommendation engine provided at least by the one or more processors to determine one or more potential indexes to be evaluated, wherein the one or more potential indexes comprise a set of custom indexes and native skinny indexes that could be built on columns that are filtered or sorted on in the query, to evaluating, with the tuning query recommendation engine, the one or more potential indexes to determine if an optimization utilizing a selected potential index provides improved performance over performing the database query without the selected potential index by performing, for each potential index, an evaluation with sampled pre-queries to estimate selectivity of the corresponding potential index, to score the one or more potential indexes based on results of the evaluating with the tuning query recommendation engine, to provide, with the tuning query recommendation engine, a recommendation of one or more of the potential indexes to a source of the database query via a query plan user interface configured to receive user input, wherein the user interface provides at least a cardinality and a table size for the tables to which recommendations correspond and one or more recommended potential indexes that would perform better than an existing best option based on existing indexes, wherein the user interface further provides indications of which tables various recommendations can be applied and indications of which fields to which various recommendations can be applied, and to build, with the tuning query recommendation engine, at least one of the one or more potential indexes in response to a received indication.
Dependencies are inferred from the claim text.