IP Library Granted Patent US 7,930,296
Granted Patent B2
US 7,930,296 · App. 12/105,754 · Granted Apr 19, 2011

Building database statistics across a join network using skew values

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 7,930,296
App. No.
12/105,754
Granted
Apr 19, 2011
Kind
B2
Abstract

An apparatus and program product that build column statistics utilizing at least one skew value. The column statistics built using skew values, instead of column statistics built only through random sampling, may be used to more accurately reflect skew values across join networks, and thus enable a query optimizer to better select an access plan that is optimal under current runtime conditions.

Claims (17)

1. An apparatus, comprising:

at least one processor;

a memory; and

program code resident in the memory and configured to be executed by the at least one processor to build database statistics, the program code configured to build a first column statistic for a first column in a first table, including detecting a skew value in the first column statistic, and based upon the skew value detected in the first column statistic, use the skew value to build a second column statistic for a second column in a second table that is likely to be joined with the first column in a database query, wherein the program code is configured to build the second column statistic by including the skew value with a random sample of values in the second column, and wherein the program code is configured to determine that the second column is more unique than the first column, and to build the first column statistic before building the second column statistic based upon the determination that the second column is more unique than the first column.

2. The apparatus of claim 1 , wherein the program code is configured to build the first column statistic by including the skew value with a random sample of values in the first column.

3. The apparatus of claim 1 , wherein the first column statistic and the second column statistic include at least one of a frequent value list, a data distribution, a histogram, an index, and an encoded vector index.

4. The apparatus of claim 1 , wherein the program code is configured to detect at least one skew value in the second column statistic.

5. The apparatus of claim 4 , wherein the program code is configured to rebuild the first column statistic using the detected skew value in the second column statistic.

6. The apparatus of claim 1 , wherein the program code is configured to store at least one detected skew value for building at least one column statistic.

7. A program product, comprising:

program code configured to build database statistics by building a first column statistic for a first column in a first table, including detecting a skew value in the first column statistic, and based upon the skew value detected in the first column statistic, use the skew value to build a second column statistic for a second column in a second table that is likely to be joined with the first column in a database query, wherein the program code is configured to build the second column statistic by including the skew value with a random sample of values in the second column, and wherein the program code is configured to determine that the second column is more unique than the first column, and to build the first column statistic before building the second column statistic based upon the determination that the second column is more unique than the first column; and

a recordable computer readable medium bearing the program code.

8. The program product of claim 7 , wherein the program code is configured to build the first column statistic by including the skew value with a random sample of values in the first column.

9. The program product of claim 7 , wherein the first column statistic and the second column statistic include at least one of a frequent value list, a data distribution, a histogram, an index, and an encoded vector index.

10. The program product of claim 7 , wherein the program code is configured to detect at least one skew value in the second column statistic.

11. The program product of claim 10 , wherein the program code is configured to rebuild the first column statistic using the detected skew value in the second column statistic.

12. The program product of claim 7 , wherein the program code is configured to store at least one detected skew value for building at least one column statistic.

Assignments (1)
CHANGE OF NAME Recorded Dec 20, 2021
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 058553/0802 →