摘要 |
Database system and methods are described for improving execution speed of database queries (e.g., for decision support) by optimizing execution of nested queries or "subqueries," such as are commonly used in client/server database environments. In particular, a subquery cache is provided having a size which can be dynamically adjusted by the system during execution of the query, for achieving an optimal cache size. During execution of the subquery, the system keeps statistics on cache "hits" and "misses." Specifically, the system stores a count of the number of times a row is found in the cache (i.e., a "hit") as well as a count of the number of times a scan of the cache yields no "hit" (i.e., a "miss"). Also, a maximum LRU (least-recently used) depth of the deepest hit in the cache is also tracked. This tracks how deep (i.e., the deepest row) into the cache there has been a "hit." Based on the tracking of these cache statistics, the system of the present invention can dynamically adjust subquery cache size to an optimal size at execution time based on actual data encountered during execution of the query.
|