Patent ID: 8326824
Filing Date: 2012-12-04
Classification: G06F

Abstract:
1. A method for estimating contents of a cache by a computer comprising a processor, comprising: determining, by the processor, table descriptors referenced by a query, wherein each table descriptor identifies one or more tables in a database system, wherein the determining table descriptors referenced by the query comprises: providing a central lookup table comprising a page count entry corresponding to a table descriptor for each table in the database system; using a single scan of each page header stored in the cache, determining, by the processor, if a table descriptor from each page header matches any of the table descriptors referenced by the query; for each table descriptor from the page headers stored in the cache determined to match any of the table descriptors referenced by the query, increasing, by the processor, a page count value corresponding to the matching table descriptor referenced by the querying, wherein the page count value corresponding to the table descriptor for each table in the database is set to an initial value in an intermediate memory, wherein the increasing the page count value corresponding to the matching table descriptor referenced by the query further comprises: updating the corresponding page count value in the central look-up table with the page count values corresponding to the matching table descriptor referenced by the query; estimating, by the processor, the contents of the cache using the page count values for each table descriptor referenced by the query; and calculating, by the processor, a cost of a query execution plan for the query using the estimated contents of the cache.