IP Library Granted Patent US 9,946,750
Granted Patent B2
US 9,946,750 · App. 14/474,682 · Granted Apr 17, 2018

Estimating statistics for generating execution plans for database queries

Inventors: Richard L. Cole (Los Gatos, CA); Sergei Perfilov (San Jose, CA)
Assignee: Actian Corporation
G06F17/30463
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,946,750
App. No.
14/474,682
Granted
Apr 17, 2018
Kind
B2
Abstract

A database system identifies missing statistics that is not available for processing database queries and determines the missing statistics. The database system generates execution plans for database queries. The database system requests certain statistical information for generating a database query. If the database system determines that the requested statistical information is not available, the database system stores information describing the requested statistical information as missing statistics. The missing statistics may identify one or more columns associated with tables processed by the database query. The database system performs statistical analysis of database tables to generate the missing statistics so that the statistical information is available for generating execution plans for subsequent queries. The database system may rank the missing statistics based on the number of times the missing statistics was identified by the database system while processing database queries.

Claims (61)

1. A computer-implemented method for generating statistics for processing database queries, the method comprising:

receiving, by a query compiler, from a client device, a plurality of database queries by a database system, the database queries processing data stored in database tables of the database system;

identifying, by the query compiler, missing statistics while generating execution plans for database queries, the identifying comprising, for each of the plurality of database queries:

requesting a statistical information useful for generating an execution plan for a database query; and

determining that the requested statistical information is not available; and

storing information describing the requested statistical information as missing statistics, responsive to determining that the requested statistical information is not available;

ranking the identified missing statistics based on a number of times each missing statistics was identified as being not available during generation of execution plan;

determining a subset of the identified missing statistics for use in generating execution plans for subsequent database queries, wherein determining the subset comprises selecting identified missing statistics based on the ranking;

receiving, by the query compiler, the subsequent database queries;

generating, by the query compiler, an execution plan for the one of the subsequent database queries using at least one of the identified missing statistics from the subset;

executing, by an execution engine, the generated execution plan for the one of the subsequent queries to determine a result set; and

sending the determined result set to the client device.

2. The computer-implemented method of claim 1 , wherein the requested statistical information is associated with one or more columns of database tables and wherein storing information describing the requested statistical information comprises storing information identifying the one or more columns.

3. The computer-implemented method of claim 1 , wherein the identified missing statistics is a multi-column number of distinct values (NDV) of a plurality of columns used in a database query.

4. The computer-implemented method of claim 1 , wherein identifying the missing statistics for a database query comprises:

determining that the database query processes a plurality of columns; and

responsive to determining that the database query processes a plurality of columns, identifying the statistical information to be a multi-column NDV of the plurality of columns.

5. The computer-implemented method of claim 4 , wherein the database query specifies a comparison of each column from the plurality of columns with a corresponding constant value.

6. The computer-implemented method of claim 4 , wherein the database query specifies a grouping of results of the database query based on distinct values of the plurality of columns.

7. The computer-implemented method of claim 4 , the database query specifies an equijoin operation based on columns from the plurality of columns.

8. The computer-implemented method of claim 1 , wherein determining the subset of the identified missing statistics comprises selecting missing statistics that was identified as missing for queries processed by a particular application.

9. The computer-implemented method of claim 1 , wherein determining the subset of the identified missing statistics comprises selecting missing statistics that was identified as missing for queries taking more than a threshold amount of time for processing.

10. The computer-implemented method of claim 1 , wherein determining the subset of the identified missing statistics comprises selecting missing statistics that was identified as missing for queries executed in a given time interval.

11. The computer-implemented method of claim 1 , wherein determining the subset of the identified missing statistics comprises selecting missing statistics that was identified as missing for queries associated with one of: a particular user, an application, or a work-load-management related identifier.

12. A non-transitory computer readable storage medium storing instructions thereon, the instructions for execution by a computer processor to cause the computer processor to perform:

receiving, by a query compiler from a client device, a plurality of database queries by a database system, the database queries processing data stored in database tables of the database system;

identifying, by the query compiler, missing statistics while generating execution plans for database queries, the identifying comprising, for each of the plurality of database queries:

requesting a statistical information useful for generating an execution plan for a database query;

determining that the requested statistical information is not available; and

storing information describing the requested statistical information as missing statistics, responsive to determining that the requested statistical information is not available;

ranking the identified missing statistics based on a number of times each missing statistics was identified as being not available during generation of execution plan;

determining a subset of the identified missing statistics for use in generating execution plans for subsequent database queries, wherein determining the subset comprises selecting identified missing statistics based on the ranking;

receiving, by the query compiler, the subsequent database queries;

generating, by the query compiler, an execution plan for the one of the subsequent database queries using at least one of the identified missing statistics from the subset;

executing, by an execution engine, the generated execution plan for the one of the subsequent queries to determine a result set; and

sending the determined result set to the client device.

13. The non-transitory computer readable storage medium of claim 12 , wherein the requested statistical information is associated with one or more columns of database tables and wherein storing information describing the requested statistical information comprises storing information identifying the one or more columns.

14. The non-transitory computer readable storage medium of claim 12 , wherein identifying the missing statistics for a database query comprises:

determining that the database query processes a plurality of columns; and

responsive to determining that the database query processes a plurality of columns, identifying the statistical information to be a multi-column NDV of the plurality of columns.

15. The non-transitory computer readable storage medium of claim 14 , wherein the database query specifies a comparison of each column from the plurality of columns with a corresponding constant value.

16. The non-transitory computer readable storage medium of claim 12 , wherein instructions for determining the subset of the identified missing statistics comprise instructions for selecting missing statistics that was identified as missing for database queries processed by a particular application.

17. The non-transitory computer readable storage medium of claim 12 , wherein instructions for determining the subset of the identified missing statistics comprise instructions for selecting missing statistics that was identified as missing for database queries associated with one of: a particular user, an application, a time window, or a work-load-management related identifier.

18. A computer-implemented system for generating statistics for a database system, the system comprising:

a computer processor; and

a computer-readable storage medium storing instructions thereon, the instructions for execution by a computer processor to cause the computer processor to perform:

receiving, by a query compiler, from a client device, a plurality of database queries by a database system, the database queries processing data stored in database tables of the database system;

identifying, by the query compiler, missing statistics while generating execution plans for database queries, the identifying comprising, for each of the plurality of database queries:

requesting a statistical information useful for generating an execution plan for a database query;

determining that the requested statistical information is not available; and

storing information describing the requested statistical information as missing statistics, responsive to determining that the requested statistical information is not available;

ranking the identified missing statistics based on a number of times each missing statistics was identified as being not available during generation of execution plan;

determining a subset of the identified missing statistics for use in generating execution plans for subsequent database queries, wherein determining the subset comprises selecting identified missing statistics based on the ranking;

receiving, by the query compiler, the subsequent database queries;

generating, by the query compiler, an execution plan for the one of the subsequent database queries using at least one of the identified missing statistics from the subset;

executing, by an execution engine, the generated execution plan for the one of the subsequent queries to determine a result set; and

sending the determined result set to the client device.

19. The computer-implemented system of claim 18 , wherein instructions for identifying the missing statistics for a database query comprise instructions for:

determining that the database query processes a plurality of columns; and

responsive to determining that the database query processes a plurality of columns, identifying the statistical information to be a multi-column NDV of the plurality of columns.

20. The computer-implemented system of claim 19 , wherein the database query specifies a comparison of each column from the plurality of columns with a corresponding constant value.

Assignments (5)
RELEASE OF SECURITY INTEREST Recorded Jul 24, 2018
From: VIRTUS GROUP, LP
To: ACTIAN CORPORATION; PARACCEL LLC; PERVASIVE SOFTWARE INC.; VERSANT SOFTWARE LLC
Reel/Frame 046621/0033 →
SECURITY INTEREST Recorded Jul 1, 2017
From: ACTIAN CORPORATION; PARACCEL LLC; PERVASIVE SOFTWARE INC.; VERSANT SOFTWARE LLC
To: VIRTUS GROUP, LP
Reel/Frame 042881/0075 →
RELEASE OF SECURITY INTEREST Recorded Jun 30, 2017
From: TC LENDING, LLC
To: ACTIAN CORPORATION; VERSANT CORPORATION (NKA VERSANT SOFTWARE LLC); PERVASIVE SOFTWARE INC.; PARACCEL LLC; ACTIAN INTERNATIONAL, INC.; VERSANT SOFTWARE LLC; POET HOLDINGS, INC.
Reel/Frame 042880/0155 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 22, 2016
From: COLE, RICHARD L.; PERFILOV, SERGEI
To: PARACCEL LLC
Reel/Frame 038985/0377 →
PLEDGE SUPPLEMENT Recorded Oct 30, 2014
From: PARACCEL LLC; ACTIAN CORPORATION
To: TC LENDING, LLC
Reel/Frame 034112/0859 →
Continuity (2)
Provisional Application 61910381 · Dec 1, 2013
Related Publication 20150154255A1 · Jun 4, 2015