IP Library › Granted Patent US 10,262,033
Granted Patent B2
US 10,262,033 · App. 15/073,890 · Granted Apr 16, 2019

Method for query execution planning

Inventors: Andreas Brodt (Gerlingen, DE); Oliver Schiller (Dettingen, DE); Marc Schwind (Holzgerlingen, DE); Mathias Trumpp (Ulm, DE)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F17/30463G06F17/30339G06F17/30469G06F17/30536
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,262,033
App. No.
15/073,890
Granted
Apr 16, 2019
Kind
B2
Abstract

The present disclosure provides a computer implemented method and system for processing queries. The first data table comprises a set of data blocks. Each of the set of data blocks may be assigned respective attribute value information. A query involving a query condition on at least a first attribute of the first data table may be received. And a subset of the set of data blocks to be accessed may be selected based on the query condition and using the attribute value information. Furthermore, a guaranteed bound may be determined for a statistical metric on the first attribute based on at least one of the number of data blocks of the subset of data blocks and the attribute value information of the subset of data blocks. The guaranteed bound for the statistical metric may be used when determining a query execution plan for the received query.

Claims (112)

1. A computer system for generating feedback for query execution, the computer system comprising:

one or more computer processors;

one or more computer-readable storage media;

program instructions stored on the computer-readable storage media for execution by at least one of the one or more processors, the program instructions comprising:

instructions to provide attribute value information for the set of data blocks;

instructions to receive a query involving a query condition on at least a first attribute of the first data table;

instructions to select a subset of the set of data blocks to be accessed based on the query condition and using the attribute value information, wherein the attribute value information of the data block is indicative of a minimum and maximum values of the first attribute in the data block, the method comprising determining a smallest minimum (α c ) and a largest maximum (ω c ) values of the first attribute, representing a range of values, in the subset of data blocks using the attribute value information of the subset of data blocks, an upper bound for the number of distinct values of the first attribute being defined by the following formula: ω c −α c +1, wherein the range of values comprises at least two sub ranges separated by at least one gap (n) covering a range of values (ω i −α i +1) of the first attribute higher than a predefined threshold gap, the upper bound for the number of distinct values of the first attribute being defined by the following formula:

ω

c

-

α

c

+

1

-

∑

i

=

1

n

⁢

⁢

(

ω

i

-

α

i

+

1

)

;

instructions to determine a guaranteed bound for a statistical metric on the first attribute based on at least one of the number of data blocks of the subset of data blocks and the attribute value information of the subset of data blocks; and

instruction to determine a query execution plan for the received query using the guaranteed bound for the statistical metric.

2. The computer system of claim 1 , wherein the upper bound for the statistical metric being a number of rows in the subset of data blocks.

3. The computer system of claim 2 , wherein the upper bound for the number of rows is defined by adding estimated largest possible number of rows in each data block of the subset of data blocks.

4. The computer system of claim 2 , wherein the set of data blocks comprises a same number of rows, the upper bound for the number of rows being:

table

⁢

⁢

cardinality

*

Q

#

⁢

⁢

total

⁢

⁢

data

⁢

⁢

blocks

wherein table cardinality is the number of rows in the first data table, |Q| is the number of data blocks in the subset of data blocks and #total data blocks is the number of data blocks in the set of data blocks.

5. The computer system 1 , wherein the first attribute comprises at least one of: integer number, fixed size string, decimals, fixed size string, Boolean, enumeration.

6. The computer system 1 , wherein the query includes a query condition on the first attribute and a second attribute of the first data table, the query conditions on the first and second attributes are dependent on each other.

7. A computer program product for generating feedback for query execution, comprising a computer-readable storage medium having program code embodied therewith, the program code executable by a processor of a computer to perform a method comprising:

providing attribute value information for the set of data blocks;

receiving a query involving a query condition on at least a first attribute of the first data table;

selecting a subset of the set of data blocks to be accessed based on the query condition and using the attribute value information, wherein the attribute value information of the data block is indicative of a minimum and maximum values of the first attribute in the data block, the method comprising determining a smallest minimum (α c ) and a largest maximum (ω c ) values of the first attribute, representing a range of values, in the subset of data blocks using the attribute value information of the subset of data blocks, an upper bound for the number of distinct values of the first attribute being defined by the following formula: ω c −α c +1, wherein the range of values comprises at least two sub ranges separated by at least one gap (n) covering a range of values (ω i −α i +1) of the first attribute higher than a predefined threshold gap, the upper bound for the number of distinct values of the first attribute being defined by the following formula:

ω

c

-

α

c

+

1

-

∑

i

=

1

n

⁢

(

ω

i

-

α

i

+

1

)

;

determining a guaranteed bound for a statistical metric on the first attribute based on at least one of the number of data blocks of the subset of data blocks and the attribute value information of the subset of data blocks; and

determining a query execution plan for the received query using the guaranteed bound for the statistical metric.

8. The computer program product of claim 7 , wherein the upper bound for the statistical metric being a number of rows in the subset of data blocks.

9. The computer program product of claim 8 , wherein the upper bound for the number of rows is defined by adding estimated largest possible number of rows in each data block of the subset of data blocks.

10. The computer program product of claim 8 , wherein the set of data blocks comprises a same number of rows, the upper bound for the number of rows being:

table

⁢

⁢

cardinality

*

|

Q

|

#

⁢

⁢

total

⁢

⁢

data

⁢

⁢

blocks

wherein table cardinality is the number of rows in the first data table, |Q| is the number of data blocks in the subset of data blocks and #total data blocks is the number of data blocks in the set of data blocks.

11. The computer program product 7 , wherein the first attribute comprises at least one of: integer number, fixed size string, decimals, fixed size string, Boolean, enumeration.

12. The computer program product 7 , wherein the query includes a query condition on the first attribute and a second attribute of the first data table, the query conditions on the first and second attributes are dependent on each other.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2016
From: BRODT, ANDREAS; SCHILLER, OLIVER; SCHWIND, MARC; TRUMPP, MATHIAS
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 038175/0954 →
Continuity (1)
Related Publication 20170270160A1 · Sep 21, 2017