IP Library › Granted Patent US 11,016,973
Granted Patent B2
US 11,016,973 · App. 15/364,026 · Granted May 25, 2021

Query plan execution engine

Inventors: Till Merker (Sandhausen, DE); Timm Steinbeck (Neckargemuend, DE); Paul Willems (Heidelberg, DE); Oliver Horn (Nussloch, DE); Joerg Fellmann (Nussloch, DE)
Assignee: SAP SE
G06F16/24542
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 11,016,973
App. No.
15/364,026
Granted
May 25, 2021
Kind
B2
Abstract

In some aspects, there is provided a method for database query execution planning. In some aspects, a method may include receiving, at a database execution engine, a query; generating, by the database execution engine, a query algebra for the query, the query algebra optimized by a query optimizer at the database execution engine; generating, based on the optimized query algebra, a query plan for execution, the query plan including pre-compiled code and code generated just-in-time; and executing, by the database execution engine, at least part of the query plan including pre-compiled code and code generated just-in-time. Related systems, methods, and articles of manufacture are also described.

Claims (42)

1. A system comprising:

at least one data processor; and

at least one memory storing instructions which, when executed by the at least one data processor, cause operations comprising:

receiving, at a database execution engine, a query, the database execution engine interfacing a client device providing the query and interfacing a plurality of separate databases, each of which includes a first query optimizer and a first database storing a database table;

generating, by the database execution engine, a query algebra for the query;

optimizing, by a second query optimizer at the database execution engine, the query algebra;

generating, based on the optimized query algebra, a query plan for execution, the query plan including pre-compiled code and code generated just-in-time, wherein the pre-compiled code is selected for inclusion in the query plan based on a class of an operator in the optimized query algebra;

receiving, at the database execution engine and from a table adapter separate from the database execution engine, a table object generated by the table adapter, the table object providing access to the database table, the table object including a table metadata, the table metadata including a format of the database table, a physical location of the database table, and access information for accessing the database table; and

executing, by the database execution engine, at least part of the query plan including the table object, the pre-compiled code, and the code generated just-in-time, wherein the table object provides runtime access to the database table.

2. The system of claim 1 , wherein the second query optimizer selects, as part of query optimization, the pre-compiled code from a plurality of pre-compiled code.

3. The system of claim 1 , wherein the code generated just-in-time is compiled in response to receiving the query, the code generated by a compiler at the database execution engine.

4. The system of claim 1 , wherein the query algebra is organized into a hierarchical plan of operators identifying a plurality of paths within the hierarchical plan, the plurality of paths enabling pipelining of the executing.

5. The system of claim 4 , wherein each path includes an endpoint operator that lies within another path and/or is shared between two paths.

6. The system of claim 4 further comprising:

pushing one or more chunks of data up a first path to accumulate results at an endpoint; and

pushing one or more chunks of data up a second path to generate output results based on the accumulated results from the first path.

7. The system of claim 1 , wherein the query optimizer inserts adapter code into the query plan, the adapter code configured to decompose data chunks.

8. The system of claim 1 , further comprising:

calling, by the database execution engine, the table adapter to prepare the table object to enable access, during runtime, to the database table.

9. The system of claim 1 , wherein the query is received from an application separate from the database execution engine.

10. The system of claim 1 , wherein the query plan is optimized by the database execution engine.

11. The system of claim 1 , wherein the database execution engine further comprises a query execution engine configured to execute at least part of the query plan including the pre-compiled code and the code generated just-in-time.

12. A method comprising:

receiving, at a database execution engine, a query, the database execution engine interfacing a client device providing the query and interfacing a plurality of separate databases, each of which includes a first query optimizer and a first database storing a database table;

generating, by the database execution engine, a query algebra for the query;

optimizing, by a second query optimizer at the database execution engine, the query algebra;

generating, based on the optimized query algebra, a query plan for execution, the query plan including pre-compiled code and code generated just-in-time, wherein the pre-compiled code is selected for inclusion in the query plan based on a class of an operator in the optimized query algebra;

receiving, at the database execution engine and from a table adapter separate from the database execution engine, a table object generated by the table adapter, the table object providing access to the database table, the table object including a table metadata, the table metadata including a format of the database table, a physical location of the database table, and access information for accessing the database table; and

executing, by the database execution engine, at least part of the query plan including the table object, the pre-compiled code, and the code generated just-in-time, wherein the table object provides runtime access to the database table.

13. The method of claim 12 , wherein the second query optimizer selects, as part of query optimization, the pre-compiled code from a plurality of pre-compiled code.

14. The method of claim 12 , wherein the code generated just-in-time is compiled in response to receiving the query, the code generated by a compiler at the database execution engine.

15. The method of claim 12 , wherein the query algebra is organized into a hierarchical plan of operators identifying a plurality of paths within the hierarchical plan, the plurality of paths enabling pipelining of the executing.

16. A non-transitory computer-readable storage medium including program which when executed by at least one processor causes operations comprising:

receiving, at a database execution engine, a query, the database execution engine interfacing a client device providing the query and interfacing a plurality of separate databases, each of which includes a first query optimizer and a first database storing a database table;

generating, by the database execution engine, a query algebra for the query;

optimizing, by a second query optimizer at the database execution engine, the query algebra;

generating, based on the optimized query algebra, a query plan for execution, the query plan including pre-compiled code and code generated just-in-time, wherein the pre-compiled code is selected for inclusion in the query plan based on a class of an operator in the optimized query algebra;

receiving, at the database execution engine and from a table adapter separate from the database execution engine, a table object generated by the table adapter, the table object providing access to the database table, the table object including a table metadata, the table metadata including a format of the database table, a physical location of the database table, and access information for accessing the database table; and

executing, by the database execution engine, at least part of the query plan including the table object, the pre-compiled code, and the code generated just-in-time, wherein the table object provides runtime access to the database table.

17. The non-transitory computer readable medium of claim 16 , wherein the second query optimizer selects, as part of query optimization, the pre-compiled code from a plurality of pre-compiled code.

18. The system of claim 1 , wherein the plurality of databases includes at least one in-memory database system.

19. The system of claim 1 , wherein the plurality of databases includes at least one in-memory, column-store database system.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 29, 2016
From: MERKER, TILL; STEINBECK, TIMM; WILLEMS, PAUL; HORN, OLIVER; FELLMANN, JOERG
To: SAP SE
Reel/Frame 040456/0677 →
Continuity (1)
Related Publication 20180150518A1 · May 31, 2018
Cited By (4)
US 12,386,834 US 12,566,761 US 12,711,133 US 12,730,812