IP Library › Granted Patent US 12,455,881
Granted Patent B2
US 12,455,881 · App. 17/953,038 · Granted Oct 28, 2025

Secure query processing

Inventor: Andrei Paduroiu (Bellevue, WA)
Assignee: Amazon Technologies, Inc.
G06F16/24542G06F16/2455G06F21/6227
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,455,881
App. No.
17/953,038
Granted
Oct 28, 2025
Kind
B2
Abstract

A distributed database identifies classifications of risk associated with stages of a query plan. The distributed database generates an execution plan in which incompatible risk classifications are assigned to separate stages of an execution plan that is derived from the query plan. The stages are assigned to computing nodes for execution based, at least in part, on the risk classifications. A result for the query is generated based on execution of the stages on the assigned computing nodes.

Claims (52)

1. A system, comprising:

at least one processor; and

at least one memory that stores computer-executable instructions that, in response to execution by the at least one processor, cause the system to:

identify a first portion of a query plan, the first portion indicative of executing a user-defined function;

identify a second portion of the query plan, the second portion indicative of accessing a database table associated with a security policy, wherein each of the first and the second portions of the query plan are to be executed by different computing nodes;

generate, based at least in part on:

the identification of the first and second portions, and

a security rule that prohibits the same computing node from executing user-defined functions and accessing the database table where security of the database table could be jeopardized by execution of user-defined functions at the same computing node,

an execution plan in which the first portion is to be performed in a first stage separate from a second stage of the execution plan in which the second portion is to be performed;

cause the first stage of the execution plan to be performed on a first computing node;

cause the second stage of the execution plan to be performed on a second computing node; and

provide a result of the query based, at least in part, on the performance of the first and second stages.

2. The system of claim 1 , wherein the at least one memory comprising further computer-executable instructions that, in response to execution by the at least one processor, cause the system to:

reserve the first computing node for executing other stages comprising user-defined functions, or operations compatible with user-defined functions, in other execution plans, in response to using the first computing node to perform the first stage comprising the user-defined functions.

3. The system of claim 1 , wherein the at least one memory comprising further computer-executable instructions that, in response to execution by the at least one processor, cause the system to:

select the second computing node to perform the second stage of the execution plan based, at least in part, on a determination that the second computing node has not been used to execute a user-defined function.

4. The system of claim 1 , wherein the database table stores data on behalf of a plurality of users and the security policy limits access by any one user to a subset of the table associated with that one user.

5. A computer-implemented method of processing a query of a database, comprising:

identifying a first portion of a query plan associated with a first classification of risk;

identifying a second portion of a query plan associated with a second classification of risk, wherein each of the first and the second portions of the query plan are to be executed by separate computing nodes in accordance with a security rule that prohibits the same computing node from executing at least one type of function and accessing at least one type of data where security of the at least one type of data could be jeopardized by execution of the at least one type of function at the same computing node;

generating an execution plan in which the first portion is to be performed in a first stage separate from a second stage of the execution plan in which the second portion is to be performed;

performing the execution plan using at least a first computing node to execute the first stage and a second computing node to execute the second stage; and

generating results of the query based, at least in part, on execution of the first and second stages.

6. The computer-implemented method of claim 5 , wherein the first classification of risk is associated with a user-defined function and the second classification of risk is associated with multiple users sharing a table of a database.

7. The computer-implemented method of claim 5 , wherein a stage of the execution plan comprises one or more operations corresponding to one or more portions of the query plan.

8. The computer-implemented method of claim 5 , wherein a classification of risk is identified based, at least in part, on examination of at least one of a database catalog or a schema.

9. The computer-implemented method of claim 5 , wherein the first computing node is reserved for executing stages that comprise the first classification of risk and executing stages compatible with the first classification of risk.

10. The computer-implemented method of claim 5 , further comprising:

determining that the second computing node has not been, and is not being, used to execute a stage associated with the first classification of risk; and

selecting the second computing node to execute the second stage based, at least in part, on the determining.

11. The computer-implemented method of claim 5 , further comprising:

generating a version of the query plan in which portions of the query plan are marked according to their respective association with a classification of risk.

12. The computer-implemented method of claim 5 , wherein the execution plan is generated based, at least in part, on assigning operations to stages according to a classification of risk associated with an assigned operation.

13. A non-transitory computer-readable storage medium storing thereon executable instructions that, as a result of being executed by one or more processors of a computer system, cause the computer system to at least:

identify a first portion of a query plan associated with a first classification of risk;

identify a second portion of a query plan associated with a second classification of risk, wherein each of the first and the second portions of the query plan are to be executed by different computing nodes;

generate an execution plan in which the first portion is to be performed in a first stage separate from a second stage of the execution plan in which the second portion is to be performed; and

cause the execution plan to be performed using at least a first computing node to execute the first stage and a second computing node to execute the second stage in accordance with a rule that prohibits the same computing node from executing at least one type of function and accessing at least one type of data where security of the at least one type of data could be jeopardized by execution of the at least one type of function at the same computing node.

14. The non-transitory computer-readable storage medium of claim 13 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

mark a portion of the query plan according to a classification of risk associated with the portion.

15. The non-transitory computer-readable storage medium of claim 13 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

identify a portion of the query plan associated with the second classification of risk; and

modify the identified portion so that the second classification of risk is associated with at least one of a child portion or sibling portion of the identified portion.

16. The non-transitory computer-readable storage medium of claim 13 , wherein the second classification of risk is associated with access to a database table that stores data on behalf of a plurality of users and a security policy that limits access by any one user to a subset of the table associated with that one user.

17. The non-transitory computer-readable storage medium of claim 13 , wherein the first computing node is reserved for executing stages that comprise user-defined functions and stages that are compatible with risk associated with executing user-defined functions.

18. The non-transitory computer-readable storage medium of claim 13 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

determine that a computing node to be used to execute a stage associated with the second classification of risk has not been used to execute a stage associated with the first classification of risk.

19. The non-transitory computer-readable storage medium of claim 13 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

select the first computing node to perform the first stage based, at least in part, on a determination that the first computing node is not currently executing a stage associated with the second classification of risk.

20. The non-transitory computer-readable storage medium of claim 13 , comprising further instructions that, as a result of being executed by the one or more processors, cause the computer system to:

identify an additional portion of the query plan that is not associated with either of the first classification of risk or the second classification of risk; and

assign the additional portions to a selected stage of the execution plan, the selection made irrespective of classifications of risk associated with other portions assigned to the selected stage.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 26, 2022
From: PADUROIU, ANDREI
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 061218/0853 →
Continuity (1)
Related Publication 20240104095A1 · Mar 28, 2024
References Cited (34)
US 7984043B1 · Waas · 2011 [cited by applicant]
US 10289723B1 · Cai · 2019 [cited by examiner]
US 11216454B1 · Cole · 2022 [cited by examiner]
US 11379480B1 · Breß · 2022 [cited by examiner]
US 11620118B2 · Schneuwly et al. · 2023 [cited by applicant]
US 11886582B1 · Abdallah · 2024 [cited by applicant]
US 20080071785A1 · Kabra · 2008 [cited by examiner]
US 20090112792A1 · Barsness · 2009 [cited by examiner]
US 20120078951A1 · Hsu · 2012 [cited by examiner]
US 20120191642A1 · George · 2012 [cited by examiner]
US 20120191690A1 · George · 2012 [cited by examiner]
US 20120317447A1 · Yildiz · 2012 [cited by examiner]
US 20130191650A1 · Balakrishnan et al. · 2013 [cited by applicant]
US 20150379076A1 · Grosse · 2015 [cited by examiner]
US 20170193054A1 · Tang · 2017 [cited by examiner]
US 20180096166A1 · Rogers et al. · 2018 [cited by applicant]
US 20190207974A1 · Jas et al. · 2019 [cited by applicant]
US 20200019722A1 · Li et al. · 2020 [cited by applicant]
US 20200349163A1 · Nadeau · 2020 [cited by examiner]
US 20200404007A1 · Singh et al. · 2020 [cited by applicant]
US 20210374235A1 · Brossard et al. · 2021 [cited by applicant]
US 20220138195A1 · Cole · 2022 [cited by examiner]
US 20220179626A1 · Kacherginsky · 2022 [cited by applicant]
US 20220374541A1 · Shigematsu · 2022 [cited by examiner]
US 20230004669A1 · Langseth et al. · 2023 [cited by applicant]
US 20230112250A1 · Agrawal et al. · 2023 [cited by applicant]
International Search Report and Written Opinion mailed Dec. 22, 2023, Patent Application No. PCT/US2023/075042, 15 pages. [cited by applicant]
Wikipedia, “User-defined Function,” Retrieved on Apr. 9, 2015 from http://en.wikipedia.org/w/index.php?ti tle=User-defined function&oldid=401094103, 4 pages. [cited by applicant]
Anonymous, “SQL Abstract Syntax Trees Vocabulary,” retrieved on Feb. 17, 2023 from http://ns.inria.fr/ast/sql/index.html, Jan. 28, 2014, 26 pages. [cited by applicant]
USPTO Non-Final Office Action dated Sep. 10, 2024, U.S. Appl. No. 18/082,559, 9 pages. [cited by applicant]
Yamaguchi et al., “Generalized Vulnerability Extrapolation Using Abstract Syntax Trees,” ACM ACSAC, 2012, 11 pages. [cited by applicant]
Zhuo et al., “Long Short-Term Memory on Abstract Syntax Tree for SQL Injection Detection,” The Institute of Engineering and Technology, Dec. 2020, 10 pages. [cited by applicant]
USPTO Non-Final Office Action dated Nov. 8, 2023, U.S. Appl. No. 17/988,724, 13 pages. [cited by applicant]
USPTO Notice of Allowance dated Jun. 11, 2025, U.S. Appl. No. 18/082,559, 8 pages. [cited by applicant]