IP Library Granted Patent US 10,650,028
Granted Patent B2
US 10,650,028 · App. 15/415,293 · Granted May 12, 2020

Relational database instruction validation

Inventors: Jesse Collins (Oakland, CA); Xuerong Tang (San Francisco, CA)
Assignee: SALESFORCE.COM, INC.
G06F16/284G06F16/217G06F16/24524
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 10,650,028
App. No.
15/415,293
Granted
May 12, 2020
Kind
B2
Abstract

In an example, a database system may be configured to validate relational database instructions using a plurality of validators. In some examples, validation may be pre-production for relational database instructions based on simulated user inputs and/or file, such as plan files (e.g., PL/SQL (procedural language/structured query language) files). In some examples, validation may be in production for relational database instructions based on system views of a database engine.

Claims (53)

1. A database system, comprising:

a processing system; and

a memory device coupled to the processing system and including instructions stored thereon that, in response to execution by the processing system, are operable to:

at a scheduled time, access a current system view of a relational database;

extract a relational database instruction from the current system view;

determine whether the extracted relational database instruction corresponds to any relational database instructions of any previously accessed system views of the relational database;

based on a result of the determination, analyze the extracted relational database instruction by inputting the extracted relational database instruction into a validation module;

wherein the validation module includes validators configured to parse structured query language text into a parse tree to identify elements in the parse tree, the validators further configured to employ rule-based validation responsive to identification of the elements in the parse tree and with respect to the elements, wherein the rule-based validation is based on requirements of a database engine of the relational database; and

store a result of the analysis in a memory device.

2. The database system of claim 1 , wherein the instructions are further operable to:

identify at least one of a current time or a parameter indicative of a current utilization of the database engine of the relational database; and

select a subset of the validators responsive to the current time or the parameter, wherein inputting the extracted relational database instruction into the validation module is based on a selection of the subset of the validators.

3. The database system of claim 2 , wherein an unselected subset of the validators includes a plan validator of the validators.

4. The database system of claim 1 , wherein the instructions are further operable to provide the result of the analysis to a metric generation module to generate metric data based on raw data of the result of the analysis.

5. The database system of claim 1 , wherein the instructions are further operable to provide the result of the analysis to a logging module to generate log data responsive to the result of the analysis.

6. The database system of claim 1 , wherein the validators are further configured to:

extract, from the parse tree, transformation information usable by a plan validator of the validators to obtain an explain plan for the relational database instruction.

7. The database system of claim 6 , wherein the transformation information includes at least one of filter columns, join columns, or table identities.

8. The database system of claim 7 , wherein the transformation information includes the table identities, and wherein the table identities comprise table names or table aliases.

9. The database system of claim 6 , wherein the plan validator comprises a join-type plan validator.

10. The database system of claim 1 , wherein the system views are generated by the database engine of the relational database, and wherein the system views are associated with a plurality of automatically generated relational database instructions that are from an instruction generation module and based on communications from user systems.

11. The database system of claim 1 , wherein the relational database instruction comprises an SQL (structured query language) statement.

12. The database system of claim 1 , wherein the validators are further configured to ascertain whether the relational database instruction includes a predefined table operation to operate on a predefined table type or a table having an attribute corresponding to a predefined attribute.

13. The database system of claim 6 , wherein the explain plan comprises a plan tree structure having a plurality of nodes.

14. The database system of claim 1 , wherein the validators are further configured to:

compare table operations of a plurality of nodes of a plan tree structure obtained from the relational database to a list of predefined table operations;

apply a plurality of rules responsive to a result of the comparison.

15. The database system of claim 12 , wherein the validators are further configured to:

parse a target relational database instruction into a parse tree, wherein the parse tree includes elements comprising at least one of tables, columns in filters, columns in join conditions, or a relational database instruction hint;

identify an element of the elements of the parse tree; and

apply a plurality of rules to the identified element.

16. The database system of claim 12 , wherein the predefined table operations comprise at least one of full scan or full index scan.

17. The database system of claim 12 , wherein the predefined table type comprises tables larger than a threshold size.

18. The database system of claim 1 , wherein the validators include a plan validator, and wherein the plan validator is configured to:

ascertain whether the relational database instruction includes a nested loop table operation; and

responsive to a result of the ascertainment, identify whether the relational database instruction includes a valid index for columns of a join of the nested loop table operation.

19. The database system of claim 1 , wherein the validators include a plan validator, and wherein the plan validator is configured to:

ascertain whether the relational database instruction includes a hash join table operation; and

responsive to a result of the ascertainment, identify whether the hash join table operation includes a filter.

20. The database system of claim 1 , wherein the validators include a plan validator, and wherein the plan validator is configured to:

ascertain whether the relational database instruction includes at least one of a semi-join table operation or an anti-join table operation; and

response to a result of the ascertainment, identify whether a table operation type indicated by a plan tree node corresponds to a table operation type indication by a join hint of the relational database instruction.

21. The database system of claim 14 , wherein the plan tree structure includes a plurality of nodes.

22. The database system of claim 1 , wherein the rule-based validation comprises leading index checking, index hint checking, or table hint checking.

23. A method, comprising:

accessing a current system view of a relational database;

extracting a relational database instruction from the current system view;

determining whether the extracted relational database instruction corresponds to any relational database instructions of any previously accessed system views of the relational database;

based on a result of the determining, analyzing the extracted relational database instruction by inputting the extracted relational database instruction into a validation module, including:

parsing structured query language text into a parse tree to identify elements in the parse tree; and

employing rule-based validation responsive to identification of the elements in the parse tree and with respect to the elements, wherein the rule-based validation is based on requirements of a database engine of the relational database; and

storing a result of the analyzing in a memory device.

24. The method of claim 23 , wherein the rule-based validation comprises leading index checking, index hint checking, or table hint checking.

Assignments (2)
CHANGE OF NAME Recorded Oct 30, 2023
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 065394/0169 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 25, 2017
From: COLLINS, JESSE; TANG, XUERONG
To: SALESFORCE.COM, INC.
Reel/Frame 041081/0571 →
Continuity (1)
Related Publication 20180210910A1 · Jul 26, 2018
Cited By (4)
US 12,229,146 US 12,326,851 US 12,572,525 US 12,694,031