Method and system for sample size determination for database optimizers
AssigneeOracle International Corporation
InventorAri W. Mozes
Life of this patent
Estimating the term…
Abstract
A system and method for determining an adequate sample size for statistics collection is disclosed. A mechanism for automatically determining an adequate sample size for both statistics and histograms is provided. The sample size determination is accomplished via an iterative approach where the process starts with a small sample, and for each attribute which may need more data, the sample size is increased while restricting the information collected to only those attributes that require the larger sample.
Claims70
A method for determining sample size for statistics collection in a database system, comprising:
- a. selecting a sample size to determine a first set of statistics for a data population, the first set of statistics comprising a first statistic;
- b. identifying data samples from the data population corresponding to the initial sample size;
- c. making a determination of adequacy for the data samples for the first statistic, wherein determination of adequacy comprises determining whether the sample size includes at least 919 rows;
- d. if the data samples are not adequate, then increasing the sample size and repeating steps b and c;
- and
- e. if the data samples are adequate, then storing the first statistic which was generated based upon the data samples.
A method for determining sample size for statistics collection in a database system, the method comprising:
- (a) generating a statistic for a data population using a sample of data values from the data population, the sample of data values having a sample size;
- (b) determining whether the sample size is adequate for the statistic without obtaining an additional sample;
- (c) increasing the sample size and repeating (a) and (b) when the sample size is not adequate for the statistic;
- and
- (d) storing the statistic when the sample size is adequate for the statistic.
A computer program product that includes a computer-readable medium comprising a sequence of instructions which, when executed by a processor, causes said processor to execute a process for determining sample size for statistics collection in a database system, said process comprising:
- a. selecting a sample size to determine a first set of statistics for a data population, the first set of statistics comprising a first statistic;
- b. identifying data samples from the data population corresponding to the initial sample size;
- c. making a determination of adequacy for the data samples for the first statistic, wherein determination of adequacy comprises determining whether the sample size includes at least 919 rows;
- d. if the data samples are not adequate, then increasing the sample size and repeating steps b and c;
- and
- e. if the data samples are adequate, then storing the first statistic which was generated based upon the data samples.
A computer program product that includes a computer-readable medium comprising a sequence of instructions which, when executed by a processor, causes the processor to execute a process for determining sample size for statistics collection in a database system, the process comprising:
- (a) generating a statistic for a data population using a sample of data values from the data population, the sample of data values having a sample size;
- (b) determining whether the sample size is adequate for the statistic without obtaining an additional sample;
- (c) increasing the sample size and repeating (a) and (b) when the sample size is not adequate for the statistic;
- and
- (d) storing the statistic when the sample size is adequate for the statistic.
A system for determining sample size for statistics collection in a database system, comprising:
- a. means for selecting a sample size to determine a first set of statistics for a data population, the first set of statistics comprising a first statistic;
- b. means for identifying data samples from the data population corresponding to the initial sample size;
- c. means for making a determination of adequacy for the data samples for the first statistic, wherein determination of adequacy comprises means for determining whether the sample size includes at least 919 rows;
- d. means for increasing the sample size and repeating steps b and c when the data samples are not adequate;
- and
- e. means for storing the first statistic which was generated based upon the data samples when the data samples are adequate.
A system for determining sample size for statistics collection in a database system, the system comprising:
- (a) means for generating a statistic for a data population using a sample of data values from the data population, the sample of data values having a sample size;
- (b) means for determining whether the sample size is adequate for the statistic without obtaining an additional sample;
- (c) means for increasing the sample size and repeating (a) and (b) when the sample size is not adequate for the statistic;
- and
- (d) means for storing the statistic when the sample size is adequate for the statistic.
Dependencies are inferred from the claim text.