IP Library Granted Patent US 9,779,137
Granted Patent B2
US 9,779,137 · App. 14/298,201 · Granted Oct 3, 2017

Salient sampling for query size estimation

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 9,779,137
App. No.
14/298,201
Granted
Oct 3, 2017
Kind
B2
Abstract

Salient sampling for query size estimation includes identifying two or more columns in a database table that have corresponding columns in one or more other tables. One or more hash functions are applied to domains of each of the identified columns. A first hash function is applied to a domain of the first column and a second hash function to a domain of the second column. A subset of the rows in the database table is selected. The selecting includes selecting rows in the database table where results of the first hash function meet a first numeric threshold and selecting rows in the database table where results of the second hash function meet a second numeric threshold. A sample database table corresponding to the database table is created. The sample database table includes the selected subset of the rows in the database table.

Claims (51)

1. A method of creating samples of database tables, the method comprising:

identifying a first column and a second column in a first database table, each of the first and second columns having corresponding columns in one or more other database tables;

applying one or more hash functions to values in the first column and second column, the applying including applying a first hash function to the values of the first column and applying a second hash function to the values of the second column;

selecting a subset of the rows in the first database table where results of the first hash function meet a first numeric threshold, or where results of the second hash function meet a second numeric threshold;

creating a sample database table corresponding to the result of a join operation of the subset of rows of the first database table and the one or more other database tables; and

estimating a cardinality of a database query over the first database table by scaling the cardinality of the database query over the sample database table by a factor of 1/v where v is the volume of the selected subset of rows of the first database table relative to the first database table.

2. The method of claim 1 , further comprising executing a query against the sample database table.

3. The method of claim 1 , wherein the first hash function is different than the second hash function.

4. The method of claim 1 , wherein the first hash function is the same as the second hash function.

5. The method of claim 1 , wherein the first numeric threshold is different than the second numeric threshold.

6. The method of claim 1 , wherein the first numeric threshold is the same as the second numeric threshold.

7. The method of claim 1 , wherein the one of the one or more other database tables and the first and second columns are mentioned in a database query, and the identifying, applying, selecting and creating are performed for all of the database tables and columns being joined in the database query.

8. The method of claim 7 , wherein the method further comprises computing the database query over the sample database table.

9. The method of claim 7 , further comprising:

expressing the database query as the disjoint union of two or more subqueries; and

performing for each subquery:

computing the subquery over the sample database table; and

estimating a cardinality of the database query as a cardinality of the subquery over the sample database table divided by a volume of the selected subset of rows; and

adding the resulting estimates.

10. A system for creating samples of database tables, the system comprising: a memory having computer readable computer instructions; and

a processor for executing the computer readable instructions to perform a method comprising:

identifying a first column and a second column in a first database table, each of the first and second columns having corresponding columns in one or more other database tables;

applying one or more hash functions to values in the first column and second column, the applying including applying a first hash function to the values of the first column and applying a second hash function to the value of the second column;

selecting a subset of the rows in the first database table where results of the first hash function meet a first numeric threshold, or where results of the second hash function meet a second numeric threshold;

creating a sample database table corresponding to the result of a join operation of the subset of rows of the first database table and one or more other database tables; and

wherein

the first hash function is different than the second hash function.

11. The system of claim 10 , further comprising executing a query against the sample database table.

12. The system of claim 10 , wherein at least one of:

the first hash function is the same as the second hash function; and

the first numeric threshold is the same as the second numeric threshold.

13. The system of claim 10 , wherein the one or more other database tables and the first and second columns am mentioned in a database query, and the identifying, applying, selecting and creating are performed for all of the database tables and columns mentioned in the database query.

14. The system of claim 13 , wherein the method further comprises computing the database query over the sample database table.

15. The system of claim 14 , wherein the method further comprises estimating a cardinality of the database query over the first database table by scaling the cardinality of the database query over the sample database table by a factor of 1/v where v is the volume of the selected subset of rows of the first database table relative to the first database table.

16. The system of claim 13 , wherein the system further comprises:

expressing the database query as the disjoint union of two or more subqueries; and

performing for each subquery:

computing the subquery over the sample database tables; and

estimating a cardinality of the database query as a cardinality of the subquery over the sample database tables divided by a volume of the selected subset of rows; and

adding the resulting estimates.

17. A non-transitory computer readable storage medium for creating samples of database tables, the non-transitory computer readable storage medium having computer-readable program code embodied thereon, which when executed by a computer processor, causes the computer processor to implement a method, the method comprising:

identifying a first column and a second column in a first database table, each of the first and second columns having corresponding columns in one or more other database tables;

applying one or more hash functions to values in the first column and second column, the applying including applying a first hash function to the values of the first column and applying a second hash function to the values of the second column;

selecting a subset of the rows in the first database table where results of the first hash function meet a first numeric threshold, or where results of the second hash function meet a second numeric threshold;

creating a sample database table corresponding to the result of a join operation of the subset of rows of the first database table and the one or more other database tables, wherein the one or more other database tables and the first and second columns are mentioned in a database query, and the identifying, applying, selecting and creating are performed for all of the database tables and columns mentioned in the database query;

expressing the database query as the disjoint union of two or more subqueries; and

performing for each subquery:

computing the subquery over the sample database table; and

estimating a cardinality of the database query as a cardinality of the subquery over the sample database tables divided by a volume of the selected subset of rows; and

adding the resulting estimates.

18. The computer program product of claim 17 , wherein the method further comprises executing a query against the sample database table.

Assignments (8)
CHANGE OF NAME Recorded Apr 26, 2021
From: INFOR (US), INC.
To: INFOR (US), LLC
Reel/Frame 056048/0944 →
MERGER Recorded Jun 19, 2019
From: LOGICBLOX, INC.
To: LOGICBLOX-PREDICTIX ACQUISITIONCO, INC.
Reel/Frame 049519/0489 →
MERGER Recorded Jun 19, 2019
From: LOGICBLOX-PREDICTIX ACQUISTIONCO, INC.
To: LOGICBLOX-PREDICTIX MIDCO, LLC
Reel/Frame 049519/0716 →
MERGER Recorded Jun 19, 2019
From: LOGICBLOX-PREDICTIX MIDCO, LLC
To: INFOR RETAIL HOLDINGS, INC.
Reel/Frame 049519/0856 →
NUNC PRO TUNC ASSIGNMENT Recorded Jun 19, 2019
From: INFOR RETAIL HOLDINGS, INC.
To: LOGICBLOX LLC
Reel/Frame 049519/0955 →
MERGER Recorded Jun 19, 2019
From: LOGICBLOX LLC
To: INFOR (US), INC.
Reel/Frame 049520/0138 →
SECURITY INTEREST Recorded Feb 6, 2015
From: LOGICBLOX INC.
To: SILICON VALLEY BANK
Reel/Frame 034909/0756 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 6, 2014
From: VELDHUIZEN, TODD L.
To: LOGICBLOX, INC.
Reel/Frame 033049/0067 →