Generating imperative-language query code from declarative-language query code

US9886477B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9886477-B2
Application numberUS-201414523832-A
CountryUS
Kind codeB2
Filing dateOct 24, 2014
Priority dateOct 24, 2014
Publication dateFeb 6, 2018
Grant dateFeb 6, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Innovations in the area of query processing for a database management system (“DBMS”) are presented herein. For example, for a database query, a query engine generates query code in an imperative language (such as a procedural, scripting language) based on query code in a declarative language (such as a structured query language). The query engine can embed the imperative-language query code in an intermediate representation of the database query, which is executed by the DBMS. In many instances (e.g., for non-linear operations of a database query), the imperative-language query code can be executed by the DBMS more quickly and efficiently than the original declarative-language query code. The DBMS returns results of the execution of the database query.

First claim

Opening claim text (preview).

I claim: 1. One or more computer-readable storage media storing computer-executable instructions for causing a computer system when programmed thereby to perform: receiving, at a query engine, a request comprising a first version of a database query including first query code in a declarative language, the database query specifying a plurality of database operations, the plurality of database operations comprising at least one linear operation and at least one non-linear operation; with the query engine, based on the first query code, generating second query code for the at least one non-linear operation in an imperative language; with the query engine, embedding the second query code in a second version of the database query, the second version of the database query comprising the at least one linear operation specified in the declarative language and the at least one non-linear operation in the imperative language code; with an execution engine of a database management system, generating an intermediate representation of the at least one linear operation specified in a declarative language, the intermediate representation specifying one or more operations for retrieving information from one or more database records; with the execution engine, executing the intermediate representation and directly executing the imperative language code for the at least one non-linear operation, wherein the execution engine retrieves information from one or more database records as specified by the intermediate representation and performs one or more calculations on the retrieved data as specified by the at least one non-linear operation; and with the execution engine, returning execution results in response to the request. 2. The one or more computer-readable storage media of claim 1 , wherein the declarative language is a structured query language, and wherein the imperative language is a scripting language. 3. The one or more computer-readable storage media of claim 1 , wherein the second version of the database query is an intermediate representation that specifies how to retrieve and transform data responsive to the database query. 4. The one or more computer-readable storage media of claim 3 , wherein the intermediate representation represents the database query as a graph including multiple nodes, each of the multiple nodes representing a transformation on data of a column-store database, wherein the at least one linear operation forms a node of the graph. 5. The one or more computer-readable storage media of claim 4 , wherein the column-store database includes a table partitioned into columns, the table having multiple rows for records of the table, wherein a first node of the multiple nodes represents, for the second query code, a transformation to be performed on a row-after-row basis for at least some of the multiple rows of the table, and wherein a second node of the multiple nodes represents a transformation to be performed on a column-after-column basis for one or more of the columns of the table. 6. The one or more computer-readable storage media of claim 3 , wherein the intermediate representation is written in an extensible markup language file but has the second query code in the imperative language embedded therein. 7. The one or more computer-readable storage media of claim 1 , wherein the at least one non-linear operation is selected from the group consisting of determining a running minimum value, determining a running maximum value, determining a running count value, determining a running average value and determining a running sum value. 8. The one or more computer-readable storage media of claim 1 , wherein the query engine includes a library of functions for converting elements in the declarative language to elements in the imperative language, and wherein the elements in the imperative language include code blocks and statements. 9. The one or more computer-readable storage media of claim 1 , wherein the query engine is a query engine application executing in a Web application server associated with an in-memory column-store database server, and wherein the first version of the database query is received from a client application. 10. The one or more computer-readable storage media of claim 9 , further storing computer-executable instructions for causing the computer system when programmed thereby to perform: with the query engine, passing the second version of the database query to an execution engine for execution; and receiving, at the query engine, results of the execution of the database query. 11. A method comprising: with an execution engine of a database management system, receiving from a query engine a second version of a database query, the second version of the database query comprising a plurality of nodes, at least a first node comprising at least one non-linear operation specified in an imperative language and at least a second node comprising at least one linear operation specified in a declarative language according to a first version of the database query, wherein the first version of the database query comprised the at least one non-linear operation specified in a declarative language; with the execution engine, traversing the plurality of nodes of the second version of the database query, the traversing comprising: with the execution engine, for the at least a first node, generating an intermediate representation of the at least one linear operation specified in a declarative language, the intermediate representation specifying one or more operations for retrieving information from one or more database records; with the execution engine, for the at least a second node, executing the intermediate representation and directly executing the imperative language code for the at least one non-linear operation, wherein the execution engine retrieves information from one or more database records as specified by the intermediate representation and performs one or more calculations on the retrieved data as specified by the at least one non-linear operation; and with the execution engine, returning execution results in response to the request. 12. The method of claim 11 , wherein the declarative language is a structured query language, and wherein the imperative language is a scripting language. 13. The method of claim 11 , wherein the second version of the database query specifies how to retrieve and transform data responsive to the database query, and wherein the second version of the database query represents the database query as a graph including the plurality of nodes, each of the plurality of nodes representing an operation on data of a column-store database. 14. The method of claim 13 , wherein the column-store database includes a table partitioned into columns, the table having multiple rows for records of the table, wherein a first node of the plurality of nodes represents, for the second query code, an operation to be performed on a row-after-row basis for at least some of the multiple rows of the table, and wherein a second node of the multiple nodes represents an operation to be performed on a column-after-column basis for one or more of the columns of the table. 15. The method of claim 11 , wherein the at least one non-linear operation is selected from the group consisting of determining a running minimum value, determining a running maximum value, determining a running count value, determining a running average value and determining a running sum value. 16. A computer system including a processor and memory, wherein the computer system implements a database server c

Assignees

Inventors

Classifications

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9886477B2 cover?
Innovations in the area of query processing for a database management system (“DBMS”) are presented herein. For example, for a database query, a query engine generates query code in an imperative language (such as a procedural, scripting language) based on query code in a declarative language (such as a structured query language). The query engine can embed the imperative-language query code in…
Who is the assignee on this patent?
Jahankhani Saeed, Sap Se
What technology area does this patent fall under?
Primary CPC classification G06F16/2452. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Feb 06 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 1 related publication on this page (citations in our corpus or others sharing the same primary CPC).