IP Library › Granted Patent US 11,947,531
Granted Patent B1
US 11,947,531 · App. 18/109,781 · Granted Apr 2, 2024

Copy avoidance via static analysis for DBMS querying

Inventors: Altin Alickaj (Zurich, CH); Alexander Ulrich (Freiburg, DE); Lukas Stadler (Linz, AT)
Assignee: Oracle International Corporation
G06F16/2443G06F16/217G06F16/2219
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,947,531
App. No.
18/109,781
Granted
Apr 2, 2024
Kind
B1
Abstract

In a computer embodiment, in a polyglot database management system (DBMS) that contains a guest language runtime environment, a database buffer is configured that the guest language runtime environment does not manage. In the polyglot DBMS, logic that is defined in a guest language is invoked to retrieve, into the database buffer, a value stored in a database in the polyglot DBMS. Compiling the logic causes semantic analyzing the logic to detect that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer. When detecting that such usage of the retrieved value cannot occur, the logic is executed without, after the retrieved value is overwritten in the database buffer, retaining a copy of the retrieved value in a memory region that the guest language runtime environment manages.

Claims (46)

1. A method comprising:

configuring, in a polyglot database management system (DBMS) that contains a guest language runtime environment, a database buffer that the guest language runtime environment does not manage;

invoking, in the polyglot DBMS, logic that is defined in a guest language to retrieve, into the database buffer that the guest language runtime environment does not manage, a value stored in a database in the polyglot DBMS;

analyzing, after said invoking the logic, the logic to detect that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer that the guest language runtime environment does not manage; and

executing, in response to detecting that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer, the logic without, after the retrieved value is overwritten in the database buffer, retaining a retained copy of the retrieved value in a memory region that the guest language runtime environment manages.

2. The method of claim 1 wherein said detecting that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer comprises detecting that the retrieved value cannot escape the logic that is defined in the guest language.

3. The method of claim 2 wherein:

the method further comprises after said invoking in the polyglot DBMS and before said detecting that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer, inlining a second logic into the logic that is defined in the guest language;

said detecting that the retrieved value cannot escape comprises detecting that the retrieved value cannot escape the second logic inlined into the logic that is defined in the guest language.

4. The method of claim 2 wherein said detecting that the retrieved value cannot escape comprises detecting that the retrieved value cannot escape a compilation unit that contains the logic that is defined in the guest language.

5. The method of claim 1 wherein said analyzing the logic comprises analyzing liveness of the retrieved value in the logic that is defined in the guest language.

6. The method of claim 5 wherein said analyzing liveness comprises exhaustively analyzing reachability, within the logic that is defined in the guest language, of the retrieved value.

7. The method of claim 5 wherein:

the logic that is defined in the guest language comprises a database invocation;

said analyzing liveness comprises graph coloring based on liveness of the retrieved value at the database invocation.

8. The method of claim 1 wherein:

the logic that is defined in the guest language defines a subroutine that accepts a parameter;

the database buffer contains a value of the parameter;

the method further comprises analyzing the logic to detect that usage of the value of the parameter cannot occur after the retrieved value is overwritten in the database buffer that the guest language runtime environment does not manage.

9. The method of claim 1 further comprising treating the retrieved value as causing, at a deoptimization point in the logic that is defined in the guest language, at least one selected from the group consisting of a liveness violation and escape of the retrieved value.

10. The method of claim 9 wherein the deoptimization point is based on a datatype of a column in said database in the polyglot DBMS.

11. The method of claim 1 further comprising performing at least one activity selected from the group consisting of:

storage, into the memory region that the guest language runtime environment manages, a proxy that intercepts said usage of the retrieved value, and

usage of a large object (LOB) in the database buffer to provide the retrieved value to the logic that is defined in the guest language.

12. The method of claim 1 wherein:

said defined to retrieve said value into the database buffer comprises configured to use a database object to retrieve said value into the database buffer;

the method further comprises detecting that said database object cannot escape the logic that is defined in the guest language.

13. The method of claim 12 wherein said detecting that said database object cannot escape comprises detecting that the logic that is defined in the guest language is not configured to initialize the database object.

14. The method of claim 1 wherein said analyzing the logic comprises performing at least one activity selected from the group consisting of:

compilation of a compilation unit that consists essentially of an entire subroutine or less than an entire subroutine,

compilation of a compilation unit that contains the logic that is defined in the guest language, and

analysis of an intermediate representation of the logic that can be executed by interpretation.

15. One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause:

configuring, in a polyglot database management system (DBMS) that contains a guest language runtime environment, a database buffer that the guest language runtime environment does not manage;

invoking, in the polyglot DBMS, logic that is defined in a guest language to retrieve, into the database buffer that the guest language runtime environment does not manage, a value stored in a database in the polyglot DBMS;

analyzing, after said invoking the logic, the logic to detect that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer that the guest language runtime environment does not manage; and

executing, in response to detecting that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer, the logic without, after the retrieved value is overwritten in the database buffer, retaining a retained copy of the retrieved value in a memory region that the guest language runtime environment manages.

16. The one or more non-transitory computer-readable media of claim 15 wherein said detecting that usage of the retrieved value cannot occur after the retrieved value is overwritten in the database buffer comprises detecting that the retrieved value cannot escape the logic that is defined in the guest language.

17. The one or more non-transitory computer-readable media of claim 15 wherein said analyzing the logic comprises analyzing liveness of the retrieved value in the logic that is defined in the guest language.

18. The one or more non-transitory computer-readable media of claim 15 wherein the instructions further cause treating the retrieved value as causing, at a deoptimization point in the logic that is defined in the guest language, at least one selected from the group consisting of a liveness violation and escape of the retrieved value.

19. The one or more non-transitory computer-readable media of claim 15 wherein the instructions further cause performing at least one activity selected from the group consisting of:

storage, into the memory region that the guest language runtime environment manages, a proxy that intercepts said usage of the retrieved value, and

usage of a large object (LOB) in the database buffer to provide the retrieved value to the logic that is defined in the guest language.

20. The one or more non-transitory computer-readable media of claim 15 wherein:

said defined to retrieve said value into the database buffer comprises configured to use a database object to retrieve said value into the database buffer;

the instructions further cause detecting that said database object cannot escape the logic that is defined in the guest language.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 28, 2024
From: ULRICH, ALEXANDER
To: ORACLE GLOBAL SERVICES GERMANY GMBH
Reel/Frame 066592/0563 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2023
From: ORACLE GLOBAL SERVICES GERMANY GMBH
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 063215/0711 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 27, 2023
From: ULRICH, ALEXANDER
To: ORACLE GLOBAL SERVICES GERMANY GBMH
Reel/Frame 062814/0859 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 27, 2023
From: ALICKAJ, ALTIN; STADLER, LUKAS
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 062815/0018 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 15, 2023
From: ALICKAJ, ALTIN; ULRICH, ALEXANDER; STADLER, LUKAS
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 062705/0638 →