IP Library Granted Patent US 11,797,536
Granted Patent B2
US 11,797,536 · App. 17/226,646 · Granted Oct 24, 2023

Just-in-time injection in a distributed database

Inventors: Ashok Anand (Bengaluru, IN); Bhanu Prakash (Karnataka, 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 11,797,536
App. No.
17/226,646
Granted
Oct 24, 2023
Kind
B2
Abstract

Injecting override instructions associated with query executions instructions performed on a distributed database includes receiving a data-query; generating, by a first database instance, a query plan that includes a first query execution instruction for transmission to a second database instance; transmitting, by the first database instance, a request for partial results to the second database instance, where the request includes the first query execution instruction and an indication of override instructions corresponding to the first query execution instruction; responsive to a determination that the request includes the indication, including, by the second database instance, the override instructions in a set of high-level language query instructions; obtaining, by the second database instance, a machine language query based on the set; executing, at the second database instance, the machine language query to obtain the partial results; and transmitting, by the second database instance, the partial results to the first database instance.

Claims (70)

1. A method, comprising:

receiving a data-query at a distributed database, the distributed database comprising a first database instance and a second database instance;

generating, by the first database instance, a query plan for obtaining results data, wherein the query plan comprises a first query execution instruction for transmission to the second database instance;

transmitting, by the first database instance, a request for partial results to the second database instance, wherein the request comprises the first query execution instruction and an indication of override instructions corresponding to the first query execution instruction;

including, by the second database instance, the override instructions in a set of high-level language query instructions,

wherein the high-level language query instructions implement, at least in part, the first query execution instruction of the query plan and do not modify the query plan, and

wherein the override instructions replace default instructions associated with the first query execution instruction of the query plan and wherein the override instructions do not modify the query plan;

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

executing, at the second database instance, the machine language query to obtain the partial results;

transmitting, by the second database instance, the partial results to the first database instance;

obtaining, by the first database instance, the results data using the partial results; and

outputting the results data.

2. The method of claim 1 ,

wherein the query plan comprises a second query execution instruction,

wherein the request further comprises the second query execution instruction, and

wherein the method further comprising:

responsive to a determination that the request does not include an indication of override instructions for the second query execution instruction, generating default high-level language query instructions for the second query execution instruction.

3. The method of claim 2 , further comprising:

adding the default high-level language query instructions to 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 source high-level language query instructions.

6. The method of claim 1 , wherein the override instructions comprise an indication of the second database instance, and wherein the request for the partial results is transmitted to the second database instance responsive to the indication of the second database instance.

7. The method of claim 1 , wherein executing, at the second database instance, the machine language query to obtain the partial results comprises:

dynamically loading a library corresponding to the machine language query with the second database instance.

8. The method of claim 1 , wherein obtaining, by the second database instance, the machine language query from the set of high-level language query instructions comprises:

retrieving the machine language query from a cache.

9. A method for injecting custom processing at a database instance of a distributed database, comprising:

receiving at the database instance a request to execute a first query execution instruction of a query plan, wherein the request includes override instructions corresponding to first query execution instruction of the query plan, wherein the database instance is configured to generate first default high-level language query instructions for the first query execution instruction absent the override instructions, wherein the request to execute the first query execution instruction is received from a query coordinator that generated the query plan;

obtaining, using alternative high-level language query instructions obtained using the override instructions, a machine language query for obtaining partial results,

wherein the alternative high-level language query instructions are different from the first default high-level language query instructions, and

wherein the override instructions replace at least some of the first default high-level language query instructions associated with first query execution instruction of the query plan, and

wherein the alternative high-level language query instructions do not modify the query plan;

executing a clone database instance, wherein the clone database instance shares a memory space of the database instance;

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

outputting the partial results.

10. The method of claim 9 , wherein the clone database instance shares the memory space of the database instance in read-only mode.

11. The method of claim 9 , wherein the request to execute the first query execution instruction is a request to execute a portion of a query-data, and wherein the request comprises a pre-requisite table indicator.

12. The method of claim 9 , wherein obtaining the machine language query comprises:

retrieving the machine language query from a cache.

13. The method of claim 9 , further comprising:

responsive to a determination that the request does not include override instructions for a second query execution instruction included in the request, generating second default high-level language query instructions for the second query execution instruction.

14. A distributed in-memory database, comprising:

a first in-memory database instance; and

a second in-memory database instance;

wherein the first in-memory database instance is configured to:

receive a data-query;

generate a query plan for obtaining results data, wherein the query plan comprises a first query execution instruction and a second query execution instruction;

transmit a request for partial results to the second in-memory database instance, wherein the request comprises the first query execution instruction, a first indication of first override instructions corresponding to the first query execution instruction, and the second query execution instruction;

obtain, from the second in-memory database instance, the results data using the partial results; and

output the results data; and

wherein the second in-memory database instance is configured to:

responsive to a determination that the request includes the first indication of the first override instructions corresponding to the first query execution instruction, include the first override instructions corresponding to the first query execution instruction in a set of high-level language query instructions,

wherein the first override instructions replace at least some default high-level language query instructions corresponding to the first query execution instruction of the query plan, and

wherein the set of high-level language query instructions do not modify the query plan;

responsive to a determination that the request does not include a second indication of second override instructions corresponding to the second query execution instruction, include default high-level language query instructions corresponding to the second query execution instruction in the set of high-level language query instructions;

obtain a machine language query from the set of high-level language query instructions;

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

transmit the partial results to the first in-memory database instance.

15. The distributed in-memory database of claim 14 , wherein to generate the query plan comprises to:

generate a naive query plan; and

optimize the naive query plan to obtain the query plan.

16. The distributed in-memory database of claim 14 , wherein the second in-memory database instance is further configured to:

generate a second query plan, wherein the second query plan comprises the first query execution instruction.

17. The distributed in-memory database of claim 14 , wherein to obtain the machine language query from the set of high-level language query instructions comprises to:

obtain the machine language query from a cache.

18. The distributed in-memory database of claim 17 , wherein the cache is available at the in-memory second database instance.

19. The distributed in-memory database of claim 14 , wherein the second in-memory database instance is further configured to:

obtain the default high-level language query instructions from a template corresponding to the second query execution instruction.

20. The distributed in-memory database of claim 14 , wherein to obtain the machine language query from the set of high-level language query instructions comprises to:

compile the set of high-level language query instructions into at least one dynamically loadable library.

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 Apr 15, 2021
From: ANAND, ASHOK; PRAKASH, BHANU; PRAKASH, AMIT; AGRAWAL, SANJAY
To: THOUGHTSPOT, INC.
Reel/Frame 055925/0378 →
Continuity (1)
Related Publication 20220327127A1 · Oct 13, 2022