Selective cache entry removal feature
A database management system generates a cache entry system view of a database cache. Also, a new column is generated for the cache entry system view, where the new column is an ENTRY_HASH column to identify each entry of the database cache. In an example, the database management system detects a request to remove a given entry of the database cache, where the request includes a given ENTRY_HASH value to locate the given entry of the database cache. In response to receiving the request, the database management system identifies the given entry of the database cache based on the given ENTRY_HASH value. Then, the database management system removes the given entry of the database cache. Also, the database management system notifies a cache manager that the given entry has been removed.
1 . A computer-implemented method comprising:
generating a cache entry system view of a database cache;
generating a new column for the cache entry system view, wherein the new column is an entry_hash column to identify each entry of the database cache, the entry_hash column being configured as a filter to remove one or more specified entries from the database cache;
detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value to locate the given entry of the database cache;
responsive to receiving the request, identifying the given entry of the database cache based on the given entry_hash value;
removing the given entry of the database cache;
notifying a cache manager that the given entry has been removed;
inserting, into the database cache, a new entry subsequent to the removing of the given entry;
optimizing execution of a query by accessing the new entry of the database cache;
generating a new entry_hash value for the new entry of the database cache;
inserting the new entry_hash value into the new column of a corresponding row of the cache entry system view of the database cache; and
generating a query execution plan based on a query compile tree for the query responsive to inserting the new entry_hash value into the new column of the corresponding row of the cache entry system view of the database cache.
2 . The computer-implemented method of claim 1 , further comprising executing a cache removal statement to remove the given entry of the database cache.
3 . The computer-implemented method of claim 2 , wherein the cache removal statement includes the given entry_hash value and a type of the database cache.
4 . The computer-implemented method of claim 1 , further comprising:
detecting a modification of one or more source tables;
determining if any database cache entries have become stale as a result of the modification of the one or more source tables; and
generating the request to remove the given entry of the database cache responsive to determining that the given entry has become stale as a result of the modification of the one or more source tables.
5 . A system comprising:
at least one processor; and
at least one memory including program instructions which when executed by the at least one processor cause operations comprising:
generating a cache entry system view of a database cache;
generating a new column for the cache entry system view, wherein the new column is an entry_hash column to identify each entry of the database cache, the entry_hash column being configured as a filter to remove one or more specified entries from the database cache;
detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value to locate the given entry of the database cache;
responsive to receiving the request, identifying the given entry of the database cache based on the given entry_hash value;
removing the given entry of the database cache;
notifying a cache manager that the given entry has been removed;
inserting, into the database cache, a new entry subsequent to the removing of the given entry;
optimizing execution of a query by accessing the new entry of the database cache;
generating a new entry_hash value for the new entry of the database cache;
inserting the new entry_hash value into the new column of a corresponding row of the cache entry system view of the database cache; and
generating a query execution plan based on a query compile tree for the query responsive to inserting the new entry_hash value into the new column of the corresponding row of the cache entry system view of the database cache.
6 . The system of claim 5 , wherein the program instructions are further executable by the at least one processor to cause operations comprising executing a cache removal statement to remove the given entry of the database cache.
7 . The system of claim 6 , wherein the cache removal statement includes the given entry_hash value and a type of the database cache.
8 . The system of claim 5 , wherein the program instructions are further executable by the at least one processor to cause operations comprising:
detecting a modification of one or more source tables;
determining if any database cache entries have become stale as a result of the modification of the one or more source tables; and
generating the request to remove the given entry of the database cache responsive to determining that the given entry has become stale as a result of the modification of the one or more source tables.
9 . A non-transitory computer readable medium storing instructions, which when executed by at least one data processor, cause operations comprising:
generating a cache entry system view of a database cache;
generating a new column for the cache entry system view, wherein the new column is an entry_hash column to identify each entry of the database cache, the entry_hash column being configured as a filter to remove one or more specified entries from the database cache;
detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value to locate the given entry of the database cache;
responsive to receiving the request, identifying the given entry of the database cache based on the given entry_hash value;
removing the given entry of the database cache;
notifying a cache manager that the given entry has been removed;
inserting, into the database cache, a new entry subsequent to the removing of the given entry;
optimizing execution of a query by accessing the new entry of the database cache;
generating a new entry_hash value for the new entry of the database cache;
inserting the new entry_hash value into the new column of a corresponding row of the cache entry system view of the database cache; and
generating a query execution plan based on a query compile tree for the query responsive to inserting the new entry_hash value into the new column of the corresponding row of the cache entry system view of the database cache.
10 . The non-transitory computer readable medium of claim 9 , wherein the operations further comprise executing a cache removal statement to remove the given entry of the database cache.
11 . The non-transitory computer readable medium of claim 10 , wherein the cache removal statement includes the given entry_hash value and a type of the database cache.