Global query hint specification
AssigneeAmazon Technologies, Inc.
InventorsNeil Thombre, Anurag Windlass Gupta, Stefano Stefani, Aleksandras Surna
Life of this patent
Estimating the term…
Abstract
A query optimizer may receive a query (e.g., from a source that generated the query). Input that specifies both a query hint string and a hint may be received to a hint specification interface. The hint may be applied to the query, from outside the query, to optimize a query execution plan. Applying the hint may be based, at least in part, on a query hint string. For example, which query block is associated with the query hint string may be determined. Upon such a determination, the hint may be applied to the determined query block.
Claims20
A system, comprising:
- a memory;
- and
- one or more processors coupled to the memory, wherein the memory comprises program instructions that when executed by the one or more processors causes the one or more processors to:
- receive a query directed to a data store;
- separate from the received query, receive a specification of both a query hint string and a batch hint, wherein the batch hint is applicable to a plurality of query blocks of a query without specification of the batch hint in each separate one of the plurality of query blocks of that query;
- identify, based at least in part on the query hint string, two or more query blocks of the received query that are associated with the query hint string;
- optimize a query execution plan for the received query, wherein to optimize the query execution plan the program instructions cause the one or more processors to apply the batch hint to the identified two or more query blocks of the received query to modify the received query from outside the received query in accordance with the batch hint;
- and
- execute the query execution plan to query the data store.
A method, comprising:
- performing, by one or more computing devices:
- receiving a query directed to a data store;
- separate from the received query, receiving a specification of both a query hint string and a batch hint, wherein the batch hint is applicable to a plurality of query blocks of a query without specification of the batch hint in each separate one of the plurality of query blocks of that query;
- identifying, based at least in part on the query hint string, two or more query blocks of the received query that are associated with the query hint string;
- optimizing a query execution plan for the received query, wherein to optimize the query execution plan the program instructions cause the one or more processors to apply the batch hint to the identified two or more query blocks of the received query to modify the received query from outside the received query in accordance with the batch hint;
- and
- executing the query execution plan to query the data store.
A non-transitory, computer-readable storage medium, storing program instructions that when executed by one or more computing devices cause the one or more computing devices to implement:
- receiving a query directed to a data store;
- separate from the received query, receiving a specification of both a query hint string and a batch hint, wherein the batch hint is applicable to a plurality of query blocks of a query without specification of the batch hint in one or more of the plurality of query blocks of that query;
- identifying, based at least in part on the query hint string, two or more query blocks of the received query that are associated with the query hint string;
- optimizing a query execution plan for the received query, wherein to optimize the query execution plan the program instructions cause the one or more processors to apply the batch hint to the identified two or more query blocks of the received query to modify the received query from outside the received query in accordance with the batch hint;
- and
- executing the query execution plan to query the data store.
Dependencies are inferred from the claim text.