IP Library Granted Patent US 12,204,540
Granted Patent B2
US 12,204,540 · App. 18/455,774 · Granted Jan 21, 2025

Just-in-time injection in a distributed database

Inventors: Ashok Anand (Bengaluru, IN); Bhanu Prakash (Bengaluru, IN); Amit Prakash (Saratoga, CA); Sanjay Agrawal (Sammamish, WA)
Assignee: ThoughtSpot, Inc.
G06F16/24542G06F16/2433G06F16/27
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 12,204,540
App. No.
18/455,774
Granted
Jan 21, 2025
Kind
B2
Abstract

A request for database results is received from a query coordinator at a database instance of a distributed database. The request includes a query execution instruction of a query plan and an indication of override instructions corresponding to the query execution instruction. The override instructions are such that they do not modify the query plan. The database instance includes the override instructions in a set of high-level language query instructions. The database instance performs just-in-time compiling of the set of high-level language query instructions to obtain a machine language query for performing the query execution instruction of the query plan. The database instance executes the machine language query to obtain the database results. The database instance then transmits the database results to the query coordinator.

Claims (51)

1. A method, comprising:

receiving, from a query coordinator at a database instance of a distributed database, a request for database results, wherein the request comprises a query execution instruction of a query plan and an indication of override instructions corresponding to the query execution instruction, wherein the override instructions do not modify the query plan, wherein the query execution instruction comprises structured query language (SQL), and wherein the override instructions are indicative of first source code instructions written in a high-level programming language that is not SQL;

including, by the database instance, the override instructions in a set of high-level language query instructions, where the high-level language query instructions are second source code instructions written in the high-level programming language;

performing, by the database instance, just-in-time compiling of the set of high-level language query instructions to obtain a machine language query for performing the query execution instruction of the query plan;

executing, by the database instance, the machine language query to obtain the database results; and

transmitting, by database instance, the database results to the query coordinator.

2. The method of claim 1 , wherein the query plan is generated at the query coordinator of the distributed database.

3. The method of claim 1 ,

wherein the query execution instruction is a first query execution instruction,

wherein the request further comprises a second query execution instruction of the query plan, and

wherein the method further comprises:

responsive to determining that the request does not include an indication of override instructions for the second query execution instruction, including default high-level language query instructions for the second query execution instruction in the set of high-level language query instructions.

4. The method of claim 1 , wherein the indication of the override instructions comprises a file name.

5. The method of claim 1 , wherein the indication of the override instructions comprises a string containing source high-level language query instructions.

6. The method of claim 1 , wherein the indication of the override instructions comprises a directive to override the query execution instruction.

7. The method of claim 1 , wherein the database instance is a clone of another database instance of the distributed database, and wherein the database instance shares a memory space of the other database instance.

8. The method of claim 7 , wherein the memory space is shared in read-only mode.

9. A system, comprising:

a memory; and

a processor, the processor configured to executed instructions stored in the memory to:

receive, from a query coordinator, a request for database results, wherein the request comprises a query execution instruction of a query plan and an indication of override instructions corresponding to the query execution instruction, wherein the override instructions do not modify the query plan, wherein the query execution instruction comprises structured query language (SQL), and wherein the override instructions are indicative of first source code instructions written in a high-level programming language that is not SQL;

include override instructions in a set of high-level language query instructions, wherein the high-level language query instructions are second source code instructions written in the high-level programming language;

perform just-in-time compiling of the set of high-level language query instructions to obtain a machine language query for performing the query execution instruction of the query plan;

execute the machine language query to obtain the database results; and

transmit the database results to the query coordinator.

10. The system of claim 9 , wherein the query plan is generated at the query coordinator of a distributed database.

11. The system of claim 9 ,

wherein the query execution instruction is a first query execution instruction,

wherein the request further comprises a second query execution instruction of the query plan, and

wherein the processor is further configured to execute instructions stored in the memory to:

include default high-level language query instructions for the second query execution instruction in the set of high-level language query instructions.

12. The system of claim 9 , wherein the indication of the override instructions comprises a file name.

13. The system of claim 9 , wherein the indication of the override instructions comprises a string containing source high-level language query instructions.

14. The system of claim 9 , wherein the indication of the override instructions comprises a directive to override the query execution instruction.

15. The system of claim 9 , wherein the processor is further configured to execute instructions stored in the memory to:

clone a database instance of a distributed database; and

share a memory space of the database instance in read-only mode.

16. A non-transitory computer readable medium storing instructions operable to cause one or more processors to perform operations comprising:

receiving, from a query coordinator at a database instance of a distributed database, a request for database results, wherein the request comprises a query execution instruction of a query plan and an indication of override instructions corresponding to the query execution instruction, wherein the override instructions do not modify the query plan, wherein the query execution instruction comprises structured query language (SQL), and wherein the override instructions are indicative of first source code instructions written in a high-level programming language that is not SQL;

including, by the database instance, the override instructions in a set of high-level language query instructions, wherein the high-level language query instructions are second source code instructions written in the high-level programming language;

performing, by the database instance, just-in-time compiling of the set of high-level language query instructions to obtain a machine language query for performing the query execution instruction of the query plan;

executing, by the database instance, the machine language query to obtain the database results; and

transmitting, by database instance, the database results to the query coordinator.

17. The non-transitory computer readable medium of claim 16 ,

wherein the query execution instruction is a first query execution instruction,

wherein the request further comprises a second query execution instruction of the query plan, and

wherein the operations further comprise:

responsive to determining that the request does not include an indication of override instructions for the second query execution instruction, including default high-level language query instructions for the second query execution instruction in the set of high-level language query instructions.

18. The non-transitory computer readable medium of claim 16 , wherein the indication of the override instructions comprises a file name.

19. The non-transitory computer readable medium of claim 16 , wherein the indication of the override instructions comprises a string containing source high-level language query instructions.

20. The non-transitory computer readable medium of claim 16 , wherein the indication of the override instructions comprises a directive to override the query execution instruction.

Assignments (2)
SECURITY INTEREST Recorded Mar 7, 2025
From: THOUGHTSPOT, INC.; THOUGHTSPOT, LLC
To: TRIPLEPOINT CAPITAL LLC
Reel/Frame 070442/0499 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 25, 2023
From: ANAND, ASHOK; PRAKASH, BHANU; PRAKASH, AMIT; AGRAWAL, SANJAY
To: THOUGHTSPOT, INC.
Reel/Frame 064702/0907 →
Continuity (2)
Continuation 17226646 · Apr 9, 2021
Related Publication 20230401210A1 · Dec 14, 2023
References Cited (14)
US 7412456B2 · Perry · 2008 [cited by examiner]
US 10592506B1 · Thombre · 2020 [cited by examiner]
US 20060190472A1 · Perry et al. · 2006 [cited by applicant]
US 20130205022A1 · Kagan et al. · 2013 [cited by applicant]
US 20140279840A1 · Chan · 2014 [cited by examiner]
US 20170024433A1 · Neelakanthappa et al. · 2017 [cited by applicant]
US 20180121511A1 · Li et al. · 2018 [cited by applicant]
US 20180285416A1 · Bestfleisch · 2018 [cited by examiner]
US 20210089530A1 · Anand et al. · 2021 [cited by applicant]
US 20210240710A1 · Korlapati · 2021 [cited by examiner]
WO 2015167466A1 · 2015 [cited by applicant]
Wikipedia, “LLVM”, Downloaded Mar. 31, 2021, https://en.wikipedia.org/wiki/LLVM, (5 pp). [cited by applicant]
Kornacker, M., et al., “Impala: A Modern, Open-Source SQL Engine for Hadoop”, 7th Biennial Conference on Innovative Data Systems Research (CIDR'15), Jan. 2015 (10 pp). [cited by applicant]
Postgresql, “31.1 What Is JIT Compilation?”, Feb. 11, 2021, https://www.postgresql.org/docs/12/jit-reason.html (1 page). [cited by applicant]