Patent ID: 7386538
Filing Date: 2008-06-10
Classification: G06F,Y10S

Abstract:
1. A method of building database statistics, the method comprising: (a) building a first column statistic for a first column in a first table, including detecting a skew value in the first column statistic; (b) based upon the skew value detected in the first column statistic, using 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 building the second column statistic comprises including the skew value with a random sample of values in the second column; (c) storing the skew value for building at least one column statistic; and (d) determining that the second column is more unique than the first column, wherein building the first column statistic is performed before building the second column statistic based upon the determination that the second column is more unique than the first column.