Patent ID: 7814072

Claim:
A computer-implemented method of managing statistics in at least one computer comprising at least one processor and at least one storage medium, said at least one storage medium storing a database management system, comprising: causing said at least one processor to determine a value of a volatility of at least one statistic of a table, wherein said at least one statistic has values S 1 to S n ; wherein an S i represents an i th value of said S 1 to S n ; wherein said S 1 is older than said S n ; wherein a table cardinality indicates a total number of rows in said table; wherein said table cardinality comprises values TC 1 to TC n ; wherein a TC i represents an i th value of said TC 1 to TC n ; wherein said TC 1 is older than said TC n , said at least one statistic not being said table cardinality; causing said at least one processor to compute a value of a staleness of said at least one statistic based on, at least in part, multiplying said value of said volatility by a value of said at least one statistic and by a change in said table cardinality; said change in said table cardinality being a difference between another value of said table cardinality of said table and said TC n ; said TC n being older than said another value of said table cardinality; causing said at least one processor to generate at least one statistics collection task in response to, at least in part, said value of said staleness exceeding a value of a staleness threshold; and causing said at least one processor to execute said at least one statistics collection task to collect an additional value of said at least one statistic, wherein said at least one processor is caused to store said additional value of said at least one statistic in said at least one storage medium.