IP Library Granted Patent US 11,403,282
Granted Patent B1
US 11,403,282 · App. 16/542,148 · Granted Aug 2, 2022

Unbatching database queries for migration to a different database

Inventors: Florian Michael Waas (San Francisco, CA); Dmitri Korablev (San Francisco, CA); Lyublena Rosenova Antova (Sunnyvale, CA); Mohamed Soliman (Foster City, CA); Michael Alexander Duller (San Francisco, CA)
Assignee: DATOMETRY, INC.
G06F16/2379G06F11/1469G06F16/214G06F16/2452G06F16/2455G06F2201/84
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,403,282
App. No.
16/542,148
Granted
Aug 2, 2022
Kind
B1
Abstract

For a query written for a first database, some embodiments provide a method of processing the query on a second database. From a client, the method receives the query written for the first database. The method performs an automated process to analyze properties of the second database to determine that the received query should be replaced by multiple queries to the second database. Based on the determination, the method generates multiple queries for the second database. The method individually forwards each generated query to the second database for execution.

Claims (54)

1. For a query written for a first database, a method of processing the query on a second database after data is migrated from the first database to the second database, the method comprising:

from a client, receiving the query written for the first database;

retrieving properties of the second database from a metadata storage;

performing an automated process to analyze the retrieved properties of the second database to determine that the received query should be replaced by a plurality of queries to the second database;

based on the determination, generating the plurality of queries for the second database;

individually forwarding each generated query to the second database for execution; and

based on responses received from the second database after execution of the generated queries, formulating and sending a response to the received query,

wherein the first database is a first database type associated with a first query format and the second database is a second, different database type associated with a second, different query format.

2. The method of claim 1 , wherein formulating and sending the response to the received query comprises:

determining that replies have been received from the second database for all of the generated plurality of queries;

based on the determination, using the received replies to generate a single reply to the received query; and

forwarding the generated single reply to the client.

3. The method of claim 2 , wherein determining that replies have been received from the second database for all of the generated plurality of queries comprises:

associating each generated query with a same session parameter; and

using the session parameter to identify replies received from the second database as corresponding to the generated plurality of queries.

4. The method of claim 1 , wherein the client sends the query as a transaction intended for execution on the first database, wherein each generated query is executed as a separate transaction on the second database.

5. The method of claim 4 , further comprising:

receiving a reply from a particular generated query that indicates failure of the particular query's transaction; and

performing a roll back operation to restore the second database to a state prior to the failed transaction.

6. The method of claim 4 , wherein the properties of the second database comprise transaction rules regarding how a first type of database operation and a second type of database operation may be combined in a single transaction on the second database.

7. The method of claim 6 , wherein the transaction rules specify that both types of operations may not be combined in a single query, wherein each query in the generated plurality of queries comprises only one type of database operations.

8. The method of claim 6 , wherein the first type of database operations is data manipulation statements (DML), wherein the second type of database operations is data definition statements (DDL).

9. The method of claim 6 , wherein the DML statements comprise select, insert, update, and delete statements, wherein the DDL statements comprise create, alter, drop, and truncate statements.

10. The method of claim 1 , wherein the received query is in the first query format, wherein each generated query in the plurality of generated queries is in the second query format.

11. For a query written for a first database, a method of processing the query on a second database after data is migrated from the first database to the second database, the method comprising:

from a client, receiving the query written for the first database;

retrieving properties of the second database from a metadata storage;

performing an automated process to analyze the retrieved properties of the second database to determine that the received query should be replaced by a plurality of queries to the second database;

based on the determination, generating the plurality of queries for the second database, said generating comprising performing a query interpretation operation on the received query, the query interpretation operation comprising (i) translating the received query from the first query format into a second query in a third query format that is not associated with any database type, (ii) dividing the second query into the generated plurality of queries in the third query format, and (iii) translating the generated plurality of queries from the third query format into the second query format;

individually forwarding each generated query to the second database for execution; and

based on responses received from the second database after execution of the generated queries, formulating and sending a response to the received query.

12. The method of claim 11 , wherein dividing the second query into the generated plurality of queries is based on the analysis of the properties of the second database.

13. The method of claim 1 , wherein the first and second database types are each a different one of Teradata, Oracle, PostgreSQL, Amazon Redshift, Microsoft Azure SQL Data Warehouse, PostgreSQL, Pivotal Greenplum, Google BigQuery, Apache Impala, and Snowflake.

14. The method of claim 1 , wherein the metadata storage is a key-value storage in the second database.

15. For a query written for a first database, a non-transitory machine readable medium storing a program which when executed by at least one processing unit processes the query on a second database, the program comprising sets of instructions for:

from a client, receiving the query written for the first database;

retrieving properties of the second database from a metadata storage;

performing an automated process to analyze the retrieved properties of the second database to determine that the received query should be replaced by a plurality of queries to the second database;

based on the determination, generating the plurality of queries for the second database;

individually forwarding each generated query to the second database for execution; and

based on responses received from the second database after execution of the generated queries, formulating and sending a response to the received query,

wherein the first database is a first database type associated with a first query format and the second database is a second, different database type associated with a second, different query format.

16. The non-transitory machine readable medium of claim 15 , wherein the set of instructions for formulating and sending the response to the received query comprises sets of instructions for:

determining that replies have been received from the second database for all of the generated plurality of queries;

based on the determination, using the received replies to generate a single reply to the received query; and

forwarding the generated single reply to the client.

17. The non-transitory machine readable medium of claim 16 , wherein the set of instructions for determining that replies have been received from the second database for all of the generated plurality of queries comprises sets of instructions for:

associating each generated query with a same session parameter; and

using the session parameter to identify replies received from the second database as corresponding to the generated plurality of queries.

18. The non-transitory machine readable medium of claim 15 , wherein the client sends the query as a transaction intended for execution on the first database, wherein each generated query is executed as a separate transaction on the second database, the program further comprising sets of instructions for:

receiving a reply from a particular generated query that indicates failure of the particular query's transaction; and

performing a roll back operation to restore the second database to a state prior to the failed transaction,

wherein the properties of the second database comprise transaction rules that specify a first type of database operation and a second type of database operation may not be combined in a single transaction on the second database.

19. The non-transitory machine readable medium of claim 15 , wherein the received query is in the first query format, wherein each generated query in the plurality of generated queries is in the second query format.

Assignments (2)
CONFIRMATORY ASSIGNMENT Recorded Feb 26, 2026
From: DATOMETRY, INC.
To: SNOWFLAKE INC.
Reel/Frame 074957/0656 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 8, 2019
From: WAAS, FLORIAN MICHAEL; KORABLEV, DMITRI; ANTOVA, LYUBLENA ROSENOVA; SOLIMAN, MOHAMED; DULLER, MICHAEL ALEXANDER
To: DATOMETRY, INC.
Reel/Frame 050961/0868 →
Continuity (2)
Provisional Application 62807728 · Feb 19, 2019
Provisional Application 62782713 · Dec 20, 2018
Cited By (1)
US 12,681,932