IP Library › Granted Patent US 10,311,055
Granted Patent B2
US 10,311,055 · App. 15/150,363 · Granted Jun 4, 2019

Global query hint specification

Inventors: Neil Thombre (Santa Clara, CA); Anurag Windlass Gupta (Atherton, CA); Stefano Stefani (Issaquah, WA); Aleksandras Surna (Redmond, WA)
Assignee: Amazon Technologies, Inc.
G06F16/24549G06F16/2453G06F16/24534G06F16/24542G06F16/282G06F17/30442G06F17/30448G06F17/30463G06F17/30474G06F17/30589
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,311,055
App. No.
15/150,363
Granted
Jun 4, 2019
Kind
B2
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.

Claims (56)

1. 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.

2. The system of claim 1 , wherein to identify the two or more query blocks of the received query, the program instructions cause the one or more processors to:

determine that the two or more query blocks includes the query hint string; or

determine that a hashed version of the two or more query blocks matches a hash value associated with the query hint string.

3. The system of claim 1 , wherein the batch hint is received via a hint specification interface.

4. The system of claim 1 , wherein the batch hint is received prior to the query.

5. The system of claim 1 , wherein at least one of the two or more query blocks is one of nested set of query blocks in the received query, and wherein the batch hint is applied to the nested set of query blocks in the received query.

6. The system of claim 1 , wherein the program instructions cause the one or more processors to further:

receive another query directed to the data store;

identify one or more other query blocks of the other query associated with the query hint string;

optimize another query execution plan for the other query, wherein to optimize the other query execution plan the program instructions cause the one or more processors to apply the batch hint to the one or more other query blocks to modify the other query from outside the other query; and

execute the other query execution plan to query the data store.

7. The system of claim 1 , wherein the data store is a distributed data store, wherein the distributed data store comprises a plurality of storage nodes, wherein one of the storage nodes is a leader node, wherein other ones of the storage nodes are compute nodes, wherein the leader node performs the receipt of the query, the receipt of the specification of both the batch hint and the query hint string, the identification of the two or more query blocks, and the optimization of the query execution plan, and wherein the compute nodes perform the execution of the query execution plan.

8. 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.

9. The method of claim 8 , wherein identifying the two or more query blocks of the query that are associated with the batch hint string comprises:

determining that the two or more query blocks includes the query hint string; or

determining that a hashed version of the two or more query blocks matches a hash value associated with the query hint string.

10. The method of claim 8 , wherein the batch hint is received via a hint specification interface.

11. The method of claim 8 , wherein the batch hint is received prior to the received query.

12. The method of claim 8 , wherein at least one of the two or more query blocks is one of nested set of query blocks in the query, and wherein the batch hint is applied to the nested of query blocks in the query.

13. The method of claim 8 , further comprising:

receiving another query directed to the data store;

identifying one or more other query blocks of the other query associated with the query hint string;

optimizing another query execution plan for the other query, wherein to optimize the other query execution plan the program instructions cause the one or more processors to apply the batch hint to the one or more other query blocks to modify the other query from outside the other query; and

executing the other query execution plan to query the data store.

14. The method of claim 8 , wherein the data store is a distributed data store, wherein the distributed data store comprises a plurality of storage nodes, wherein one of the storage nodes is a leader node, wherein other ones of the storage nodes are compute nodes, wherein the leader node performs the receiving of the query, the receiving of the specification of both the batch hint and the query hint string, the identifying of the two or more query blocks, and the optimizing of the query execution plan, and wherein the compute nodes perform the executing of the query execution plan.

15. 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.

16. The non-transitory, computer-readable storage medium of claim 15 , wherein, in identifying the two or more query blocks of the received query, the program instructions cause the one or more computing devices to implement:

determining that the two or more query blocks includes the query hint string; or

determining that a hashed version of the two or more query blocks matches a hash value associated with the query hint string.

17. The non-transitory, computer-readable storage medium of claim 15 , wherein the batch hint is received via a hint specification interface.

18. The non-transitory, computer-readable storage medium of claim 15 , wherein the batch hint is received prior to the query.

19. The non-transitory, computer-readable storage medium of claim 15 , wherein at least one of the two or more query blocks is one of a nested set of query blocks in the query, and wherein the query hint is applied to the nested set of query blocks in the query.

20. The non-transitory, computer-readable storage medium of claim 15 , wherein the program instructions cause the one or more computing devices to further implement:

receiving another query directed to the data store;

identifying one or more other query blocks of the other query associated with the query hint string;

optimizing another query execution plan for the other query, wherein to optimize the other query execution plan the program instructions cause the one or more processors to apply the batch hint to the one or more other query blocks to modify the other query from outside the other query; and

executing the other query execution plan to query the data store.

Continuity (2)
Continuation 13766684 · Feb 13, 2013
Related Publication 20160253385A1 · Sep 1, 2016
Cited By (1)
US 12,282,502