Incrementally Updating Statistics
AssigneeHewlett-Packard Development Company, L.P.
InventorsChoudur Lakshminarayan, Ramakumar Kosuru, QiFan Chen, Hansjorg Zeller
Life of this patent
Estimating the term…
Abstract
Incrementally updating statistics includes sampling rows from a database column in a database to generate a first sample, sampling a subset of modified rows from the database column after generating the first sample to generate a second sample, determining whether distribution changes occurred to the database column based on the first and second samples, and updating a database statistic about the database column in response to determining that a distribution change exists.
Claims15
A method for incrementally updating statistics, comprising:
- sampling rows from a database column in a database to generate a first sample;
- sampling a subset of modified rows from the database column after the first sample was generated to generate a second sample;
- determining whether distribution changes occurred to the database column based on the first sample and the second sample;
- and
- updating a database statistic accordingly about the database column in response to determining that a distribution change exists.
A system for incrementally updating statistics, comprising:
- a sampling engine to sample rows from a database column in a database to generate a first sample and to sample modified rows from the database column after generating the first sample to generate a second sample;
- a determination engine to determine whether distribution changes occurred based on the first sample and the second sample;
- and
- an updating engine to update the unique entry count, the row count and the frequency of frequencies for a histogram interval and for the entire histogram statistics about the database column in response to determining that a distribution change exists.
A computer program product for incrementally updating statistics, comprising:
- a non-transitory computer readable storage medium, the non-transitory computer readable storage medium comprising computer readable program code embodied therewith, the computer readable program code comprising program instructions that, when executed, causes a processor to:
- sample rows from a database column in a database to generate a first sample;
- sample a subset of the rows, the subset including deleted rows, inserted rows, and updated rows, from the database column after generating the first sample to generate a second sample;
- build a bloom filter that represents rows of the first sample and the second sample;
- determine whether distribution changes occurred to the subset based on the first sample and the second sample;
- and
- update the unique entry count, the row count and the frequency of frequencies for a histogram interval and for the entire histogram statistics about the database column in response to determining a distribution change exists.
Dependencies are inferred from the claim text.