Selective cache entry removal feature
By introducing the selective cache entry removal feature and the ENTRY_HASH column, the problem of difficulty in efficiently removing specific cache entries in the existing technology is solved, improving the performance of the database system and user experience.
Patent Information
- Application Number
- CN202411677067.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-08
- Filing Date
- 2024-11-22
- Publication Date
- 2025-09-09
AI Technical Summary
In the prior art, when managing cache in a database system, it is difficult to efficiently remove specific cache entries without affecting other entries, resulting in resource waste and performance degradation.
Introduces a selective cache entry removal feature that allows users to precisely remove specific cache entries through SQL statements by generating a new ENTRY_HASH column, and uses shared and exclusive locks to ensure the robustness of the operation.
This achieves efficient removal of specific cache entries, improves system performance and user experience, and reduces resource waste.
Smart Images

Figure CN120610907A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to managing caches in a database environment. Background Art
[0002] Organizations increasingly need to manage large amounts of data in their database systems. Running queries on such database systems can use significant computing resources, including computer memory, storage, and processor resources. Therefore, it can be important to reuse query results whenever possible. One way to reuse query results is to cache them so that they can be used later, such as when running the same query again.
[0003] Caching query results from a particular view can save computing resources at the expense of increased memory consumption. When subsequent queries operating on the particular view are received, the cached query results can be reused. Reusing cached query results can be efficient in some cases, but it also has some disadvantages. For example, subsequent queries may perform data manipulation operations (e.g., aggregation, filtering, etc.) that require additional processing on the cached query results. This additional processing can be resource-intensive in terms of memory, storage, and / or processing resources. Summary of the Invention
[0004] In some implementations, a database management system generates a cache entry system view of a database cache. Furthermore, a new column is generated for the cache entry system view, where the new column is an ENTRY_HASH column for identifying each entry in the database cache. In an example, the database management system detects a request to remove a given entry in the database cache, where the request includes a given ENTRY_HASH value for locating the given entry in the database cache. In response to receiving the request, the database management system identifies the given entry in the database cache based on the given ENTRY_HASH value. The database management system then removes the given entry from the database cache. Furthermore, the database management system notifies a cache manager that the given entry has been removed.
[0005] Also described are non-transitory computer program products (i.e., physically embodied computer program products) storing instructions that, when executed by one or more data processors of one or more computing systems, cause at least one of the data processors to perform the operations described herein. Similarly, also described are computer systems that may include one or more data processors and a memory coupled to the one or more data processors. The memory may temporarily or permanently store instructions that cause at least one processor to perform one or more of the operations described herein. Furthermore, the methods may be implemented by one or more data processors within a single computing system or distributed across two or more computing systems. Such computing systems may be connected and may exchange data and / or commands or other instructions via one or more connections, including connections over a network (e.g., the Internet, a wireless wide area network, a local area network, a wide area network, a wired network, etc.), via direct connections between one or more of the computing systems, and the like.
[0006] The details of one or more variations of the subject matter described herein are set forth in the accompanying drawings and the description below.Other features and advantages of the subject matter described herein will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate certain aspects of the subject matter disclosed herein and, together with the description, help explain some principles associated with the disclosed implementations.
[0008] Figure 1 A logical diagram illustrating an example of a database system according to some example implementations of the current subject matter;
[0009] Figure 2 A block diagram illustrating a database system according to some example implementations of the current subject matter;
[0010] Figure 3 shows an example of a cache entry system view according to some example implementations of the current subject matter;
[0011] Figure 4 An example of a process for executing a remove cache entry statement according to some example implementations of the current subject matter is shown;
[0012] Figure 5 An example of another process for executing a remove cache entry statement according to some example implementations of the current subject matter is shown;
[0013] Figure 6 An example of a process for responding to source table modifications according to some example implementations of the current subject matter is shown;
[0014] Figure 7 An example of a process for generating a cache entry system view according to some example implementations of the current subject matter is shown;
[0015] Figure 8 shows an example of a process for inserting a new entry into a database cache according to some example implementations of the current subject matter;
[0016] Figure 9A Depicted are examples of systems according to some example implementations of the current subject matter;
[0017] Figure 9B depicts another example of a system according to some example implementations of the current subject matter; and
[0018] Figure 10 A block diagram illustrating a cache according to some example implementations of the current subject matter is shown. DETAILED DESCRIPTION
[0019] A database can include different types of caches built on a common cache infrastructure. The primary component of this common cache infrastructure is a cache manager, typically located on each index server. The common cache infrastructure provides functionality for inserting, searching, and removing cache entries. During query execution, if a valid cache entry with the result is found, the cached result is returned. Conversely, if no valid cache entry is found, the cache manager inserts the cache entry into the cache.
[0020] When database operations are of considerable duration, many cache entries may be generated to speed up cache lookup results. The number of generated cache entries will eventually exceed the size of the cache. Therefore, removing (i.e., purging) infrequently used cache entries is essential to maintaining performance and cache efficiency. Typically, purging cache entries will result in the removal of all entries of a particular cache type. In some cases, it may be necessary to flush specific cache entries rather than purging them all. For example, when modifying some source tables, removing specific cache entries is more desirable and efficient than eliminating all cache entries of a particular type and then completely reloading them. In addition, the option to remove specific cache entries is useful when high memory load entries are no longer beneficial.
[0021] The challenge is that when many cache entries are generated, users may want to remove only specific problematic cache entries without affecting other cache entries. To make the system more user-friendly, a selective cache entry removal feature can be introduced. With this feature, a new column, ENTRY_HASH, is introduced to the view M_CACHE_ENTRIES. Users can view detailed information about a specific cache entry via the M_CACHE_ENTRIES view. ENTRY_HASH can also be used as a filter to remove a specific cache entry by executing the newly added SQL statement 'ALTER SYSTEM REMOVE CACHE ('') ENTRY ('',''…)'. By running the SQL statement 'ALTER SYSTEM REMOVE CACHE ('') ENTRY ('',''…)', the cache type and ENTRY_HASH are obtained. Using the cache type, the cache instance can be exported from the cache manager. From there, the ENTRY_HASH can be matched against all relevant cache entries of that cache type. Shared locks can be used when performing parallel cache insertions and cache lookups for a specific cache type. An exclusive lock can be used for cache entry removals. Thus, if there are any cache entry removals in progress, the removals will be processed sequentially.
[0022] In the example, each cache instance manages two types of cache resources. One is a single-value cache, and the other is a transactional-value cache. For a single-value cache, there is only one cache entry for a cache key. Therefore, when the exact cache entry is found, the cache entry is removed. A transactional-value cache can contain multiple versioned cache entries for the same cache key. Subsequently, ENTRY_HASH is used to erase the matching version cache entry within its entirety. For a single-value cache, removing a cache entry means evicting the cache resource from the cache instance. However, in the case of a transactional-value cache, this action only occurs when there is only one version of the cache entry. Otherwise, removing a cache entry will not result in the eviction of the cache resource from the cache instance. The selective cache entry removal feature provides robust efficiency in removing cache entries and provides a better user experience.
[0023] Figure 1An example of a database system 110 according to some embodiments of the present subject matter is shown. Database system 110 can include any number and type of databases 115, including, for example, in-memory databases, relational databases, non-SQL (NoSQL) databases, and / or other types of databases. In an example, database 115 can be the SAP HANA database available from SAP SE, Walldorf, Germany. Database system 110 also includes a database management system (DBMS) 117. Database management system 117 can be configured to process database queries from first client 120a and / or second client 120b.
[0024] In some implementations, database system 110 and / or any of its components may be incorporated into and / or be part of a container system that may be used in a cloud implementation. Database system 110 may include any number of servers and other physical components. Furthermore, database system 110 may be communicatively coupled to a plurality of clients, including, for example, a first client 120a and a second client 120b, via a network 130. Network 130 may be a wired and / or wireless network, including, for example, a wide area network (WAN), a local area network (LAN), a public land mobile network (PLMN), the Internet, and the like. Client devices 120a-b may be processor-based devices, including, for example, one or more of a smartphone, a tablet computer, a wearable device, a virtual assistant, an Internet of Things (IoT) device, and the like.
[0025] Database system 110 may include any number of servers, each of which may run instances of corresponding executable files (e.g., .exe files) included in the kernel of database system 110. It should be understood that the kernel of database system 110 may also include other executable files (e.g., .exe files) required to run database system 110. In some implementations, the executable files may be computer programs that have been compiled into machine language (e.g., binary code) and are therefore directly executable by a data processor. In an example, database system 110 may be a dedicated single-container database system running a single instance of a primary server and / or a secondary server. However, where database system 110 implements a multi-tenant database architecture (e.g., a multi-tenant database container (MDC)), each tenant of database system 110 may be served by a separate instance of the primary server and / or the secondary server.
[0026] Now turn Figure 2, shows an example of a database system 200 according to some example embodiments. In the example, database system 200 includes a database tier 210, a server tier 215, and a client 240. Database tier 210 includes any number and type of databases 210A-210N. Databases 210A, 210B, and 210N may include any combination of one or more of a relational database, a multidimensional database, an in-memory facility, an object database, an Extensible Markup Language (XML) document, a flat file, or any other data storage system that supports structured or unstructured data. Such databases 210A-N may be distributed among several different entities.
[0027] Servers 220A-N can be any type of server, such as an index server, a primary server, a secondary server, and the like. Servers 220A-N can include any combination of one or more cloud-based or on-premise resources and can be exposed and / or accessed via one or more networks. Each server 220A-N can have one or more corresponding cache managers (CMs) 225A-N. For example, server 220A includes cache manager 225A, server 220B includes cache manager 225B, and server 220N includes cache manager 225N. Cache managers 225A-N are configured to manage caches 230A-N, which can represent any number and type of caches (e.g., a tiered cache). Clients 240 can include any number and type of clients, including smartphones 240A, computers 240B, laptops 240C, tablets 240D, and other computing devices and / or computing systems.
[0028] When database system 200 operates for a significant period of time, many cache entries in caches 230A-N may be generated to accelerate query execution by reusing query results. In some cases, it may be necessary to refresh specific cache entries rather than clearing all cache entries. For example, when modifying one or more source tables, removing specific cache entries may be more desirable and efficient than eliminating all cache entries of that type and completely reloading the cache entries. Furthermore, the option to remove specific cache entries is useful when high-memory-load entries are no longer beneficial.
[0029] In the example, each cache instance manages two cache resources. One is a single-value cache and the other is a transactional value cache. In some embodiments, the single-value cache is used to represent a single-value table column within a table or table object. The single-value cache can be included in a non-persistent or transient runtime data object. The single-value cache can be represented by a list of tuples T(a, b), where "a" is the column id of a single-valued column and "b" is a single value included in the single-valued column associated with the column id. Since a table or table object can contain a variable number of single-valued columns, the size of the single-valued cache can vary. In some embodiments, the single-valued cache is not persisted via a persistent runtime data descriptor. Instead, the persistent column descriptor of a unified table container is used to persist the single-valued cache. In some embodiments, the unified table container includes one or more persistent column descriptors for each column in the table.
[0030] Now refer to Figure 3 , shows an example of a cache entry system view 300 according to some example embodiments. In the example, the cache entry system view 300 is referred to as a cache entry system view for a database cache (e.g., Figure 2 As used herein, the term "cache entry system view" is defined as a monitoring view that provides runtime data about a plurality of cache entries of one or more database caches. Additionally, the term "monitoring view" is defined as a runtime view that includes statistics and status information related to the execution of data manipulation language (DML) statements. The cache entry system view 300 may include, for example, Figure 3 . However, these columns are merely representative of one particular embodiment. It should be understood that in other embodiments, cache entry system view 300 may be structured differently and / or include other numbers and types of columns.
[0031] like Figure 3As shown, cache entry system view 300 includes a host column 305 to display the host name, and a port column 310 to display the internal port. Moving from left to right, volume_ID column 315 displays the persistent volume identifier (ID), while cache_ID column 320 displays the ID of the cache that created the entry. entry_ID column 325 displays the ID of the cache entry, and entry_description column 330 displays a description of the cache entry. Component column 335 displays information about the component that created the cache entry, and user_name column 340 displays information about the user who created the cache entry. memory_size column 345 displays the amount of memory used to store the cache entry. In this example, memory_size column 345 displays the amount of memory in bytes. create_time column 350 displays the time the cache entry was inserted into the cache. The read_count column 355 indicates how often a cache entry was successfully read from the cache, while the last_access_time column 360 shows the time when the cache instance was last accessed.
[0032] In some embodiments, a new column ENTRY_HASH 365 can be added to the cache entry system view 300 to enable clients to remove specific cache entries from the corresponding cache. Clients can view detailed information about a specific cache entry via the cache entry system view 300. Clients can use ENTRY_HASH as a filter to remove a specific cache entry by executing the newly added SQL statement 'ALTER SYSTEM REMOVE CACHE ('') ENTRY ('',''…)'. By running the SQL statement 'ALTER SYSTEM REMOVECACHE ('') ENTRY ('',''…)', the cache type and ENTRY_HASH are obtained. Using the cache type, a cache instance can be derived by the cache manager. From here, the ENTRY_HASH can be matched against all relevant cache entries of that cache type. As used herein, the term "ENTRY_HASH column" is defined as a column in the cache entry system view, where each value in the column uniquely identifies a corresponding cache entry. Additionally, the term "ENTRY_HASH" is defined as a filter used to remove specific cache entries, such as when a remove cache statement is executed.
[0033] Now refer to Figure 4 , depicts a process for executing a remove cache entry statement according to some example embodiments. At the beginning of the process, a problematic cache entry is detected (block 405). A cache entry may be determined to be problematic based on a memory issue, a duration greater than a threshold since the cache entry was last accessed, or another issue or condition. Note that the problematic cache entry may also be referred to as a first cache entry or a given cache entry.
[0034] Next, a remove-cache-entry statement is executed to remove the problematic cache entry from the cache (block 410). Then, after the problematic cache entry is removed, one or more new cache entries are inserted into the cache (block 415). Note that the one or more new cache entries may also be referred to as a second cache entry, a third cache entry, and so on. Next, one or more queries are optimized during execution by the database system by accessing the new cache entries (block 420). Following block 420, method 400 may terminate.
[0035] Now refer to Figure 5 , depicts a process for executing a remove cache entry statement according to some example embodiments. The process begins by initiating execution of a remove cache entry statement for a first cache entry (block 505). Next, a first cache type and a first ENTRY_HASH of the first cache entry are obtained (block 510). Based on the first cache type, a cache instance is derived by the cache manager (block 515). The first ENTRY_HASH is then matched to all relevant cache entries of the first cache type (block 520). The matching cache entries are then removed from the cache (block 525). After block 525, method 500 may end.
[0036] Now turn Figure 6 , depicts a process for responding to source table modifications according to some example embodiments. A database management system detects a modification to one or more source tables (block 605). Next, in response to detecting the modification to the one or more source tables, the database management system determines which cache entries have become stale due to the modification to the one or more source tables (block 610). As used herein, the term "stale" is defined as having old or invalid data that has been updated elsewhere in the overall cache or memory subsystem. In other words, a "stale" cache entry is a cache entry that has outdated data. In the example, the database management system queries the cache system view (e.g., Figure 3 The cache system view 300) to determine which entries have become stale based on modifications.
[0037] Following block 610, the database management system executes one or more cache removal statements to remove each cache entry that has been identified as stale due to modifications to one or more source tables (block 615). In the example, the database management system executes the newly created SQL statement 'ALTER SYSTEM REMOVE CACHE ('') ENTRY ('',''...)' to remove each cache entry. Next, the database management system inserts one or more new cache entries into the one or more caches after removing each cache entry that has been identified as stale (block 620). The database management system then optimizes the execution of one or more subsequent queries by accessing the one or more new cache entries (block 625). Following block 625, the method 625 ends.
[0038] Now refer to Figure 7 , depicts a process for generating a view of a database cache according to some example embodiments. A database management system (e.g., Figure 1 The database management system 117) generates a database cache (e.g., Figure 2 cache 230A) of the cache entries system view (e.g., Figure 3 705). In addition, the database management system generates a new column for the cache entry system view, wherein the new column is an ENTRY_HASH column that uniquely identifies each entry of the database cache (block 710). Next, the database management system detects a request to remove a given entry of the database cache, wherein the request includes a given ENTRY_HASH value to locate the given entry of the database cache (block 715). In response to receiving the request, the database management system uses the given ENTRY_HASH value to identify the given entry of the database cache (block 720). The database management system then removes the given entry of the database cache (block 725). Next, the database management system notifies the cache manager (e.g., Figure 2 The cache manager 225A of the database management system (DBMS) determines that the given entry has been removed (block 730). Following block 730, method 700 may end. Note that while the database management system is described as performing the steps of method 700, it should be understood that any component or subcomponent of the database management system (e.g., an execution engine, a processor) may perform these steps. Furthermore, different components or subcomponents may perform different steps of method 700. In other words, a first subcomponent may perform a first step, a second subcomponent may perform a second step, and so on.
[0039] Now turn Figure 8, depicts a process for inserting a new entry into a database cache according to some example embodiments. A cache manager (e.g., Figure 2 The cache manager 225A of the database cache (e.g., cache 230A) inserts the new entry into the database cache (e.g., cache 230A) (block 805). Next, the cache manager notifies the database management system (e.g., Figure 1 The database management system 117 (DBMS) inserts the new entry into the database cache (block 810). In response to this notification, the database management system inserts a new row corresponding to the new entry into the cache entry system view (block 815). Also in response to this notification, the database management system generates a new ENTRY_HASH value for the new entry in the database cache (block 820). Next, the database management system inserts the new ENTRY_HASH value into the corresponding column of the new row in the cache entry system view (block 825). Following block 825, method 800 may end.
[0040] In some implementations, the current subject matter can be configured to be implemented in the system 900, such as Figure 9A As shown. System 900 may include a processor 910, memory 920, storage device 930, and input / output device 940. Each of components 910, 920, 930, and 940 may be interconnected using a system bus 950. Processor 910 may be configured to process instructions for execution within system 900. In some implementations, processor 910 may be a single-threaded processor. In alternative implementations, processor 910 may be a multi-threaded processor. Processor 910 may further be configured to process instructions stored in memory 920 or on storage device 930, including receiving or sending information via input / output device 940. Memory 920 may store information within system 900. In some implementations, memory 920 may be a computer-readable medium. In alternative implementations, memory 920 may be a volatile memory unit. In still other implementations, memory 920 may be a non-volatile memory unit. Storage device 930 may be capable of providing mass storage for system 900. In some implementations, the storage device 930 may be a computer-readable medium. In alternative implementations, the storage device 930 may be a floppy disk device, a hard disk device, an optical disk device, a magnetic tape device, a non-volatile solid-state memory, or any other type of storage device. The input / output device 940 may be configured to provide input / output operations for the system 900. In some implementations, the input / output device 940 may include a keyboard and / or a pointing device. In alternative implementations, the input / output device 940 may include a display unit for displaying a graphical user interface.
[0041] Figure 9BDepicts ( Figure 1 This example implementation of a database system 110 (see
[15] for details) is provided. Database system 110 can be implemented using various physical resources 980, such as at least one or more hardware servers, at least one storage device, at least one memory, at least one network interface, and the like. Database system 110 can also be implemented using infrastructure. As described above, the infrastructure can include at least one operating system 982 and at least one hypervisor 984 (which can create and run at least one virtual machine 986) for physical resources 980. For example, each multi-tenant application can run on a corresponding virtual machine 986.
[0042] Now refer to Figure 10 , depicts an example of a cache 1000 according to various embodiments of the current subject matter. In the example, cache 1000 includes a cache controller 1010 and arrays 1020A-N, which represent any number and type of arrays (e.g., data arrays, tag arrays). Depending on the embodiment, cache 1000 can include any suitable type and / or combination of direct-mapped and / or associative memory. In the example, ( Figure 2 Caches 230A-230N may be implemented according to the architecture of cache 1000. Alternatively, one or more of caches 230A-230N may have other types of suitable structures and / or organizations, which may vary depending on the implementation. Cache controller 1010 may be configured to perform read and write operations on arrays 1020A-N. Cache controller 1010 may also be configured to utilize any of various types of eviction policies (e.g., a least recently used (LRU) policy) to evict cache lines from arrays 1020A-N when new cache lines are to be stored in arrays 1020A-N.
[0043] The systems and methods disclosed herein can be embodied in various forms, including, for example, data processors, such as computers that also include databases, digital electronic circuits, firmware, software, or combinations thereof. In addition, the above-mentioned features and other aspects and principles of the implementations of the present disclosure can be implemented in a variety of environments. Such environments and related applications can be specially constructed to perform various processes and operations according to the disclosed implementations, or they can include general-purpose computers or computing platforms that are selectively activated or reconfigured by code to provide the necessary functionality. The processes disclosed herein are not inherently related to any particular computer, network, architecture, environment, or other device, and can be implemented by a suitable combination of hardware, software, and / or firmware. For example, various general-purpose machines can be used with programs written according to the teachings of the disclosed implementations, or special-purpose devices or systems can be more conveniently constructed to perform the desired methods and techniques.
[0044] While ordinal numbers such as first, second, and so on can refer to a sequence in some cases, as used in this document, they do not necessarily imply a sequence. For example, an ordinal number may be used simply to distinguish one item from another, such as to distinguish a first event from a second event, but need not imply any temporal order or fixed reference frame (such that the first event in one paragraph of the specification may be different from the first event in another paragraph of the specification).
[0045] The foregoing description is intended to illustrate rather than to limit the scope of the invention, which is defined by the scope of the appended claims. Other implementations are within the scope of the appended claims.
[0046] These computer programs (also referred to as programs, software, software applications, applications, components, or code) include program instructions (i.e., machine instructions) for a programmable processor and can be implemented in high-level procedural and / or object-oriented programming languages and / or assembly / machine languages. As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device for providing machine instructions and / or data to a programmable processor, such as, for example, a magnetic disk, optical disk, memory, and programmable logic device (PLD), including machine-readable media that receive program instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor. A machine-readable medium may store such program instructions non-transitorily, such as, for example, a non-transitory solid-state memory or a magnetic hard drive, or any equivalent storage medium. Alternatively or additionally, a machine-readable medium may store such machine instructions in a transient manner, such as a processor cache or other random access memory associated with one or more physical processor cores.
[0047] To provide for interaction with a user, the subject matter described herein can be implemented on a computer having a display device (such as, for example, a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user, and a keyboard and pointing device (such as, for example, a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide for interaction with the user. For example, the feedback provided to the user can be any form of sensory feedback, such as, for example, visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, voice, or tactile input.
[0048] The subject matter described herein can be implemented in a computing system that includes a back-end component (such as, for example, one or more data servers), or includes a middleware component (such as, for example, one or more application servers), or includes a front-end component (such as, for example, one or more client computers having a graphical user interface or a web browser through which a user can interact with an implementation of the subject matter described herein), or includes any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by digital data communication of any form or medium, such as, for example, a communication network. Examples of communication networks include, but are not limited to, a local area network ("LAN"), a wide area network ("WAN"), and the Internet.
[0049] A computing system may include clients and servers. A client and server are typically, but not exclusively, remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
[0050] In the above description and claims, phrases such as “at least one of…” or “one or more of…” may appear followed by a concatenated list of elements or features. The term “and / or” may also appear in a list of two or more elements or features. Unless otherwise implicitly or explicitly contradicted by the context in which it is used, such phrases are intended to mean any one of the elements or features listed individually, or any one of the recited elements or features in combination with any of the other recited elements or features. For example, the phrases “at least one of A and B;” “one or more of A and B;” and “A and / or B” are each intended to mean “A alone, B alone, or A and B together.” A similar interpretation is also intended for lists comprising three or more items. For example, the phrases “at least one of A, B, and C;” “one or more of A, B, and C;” and “A, B, and / or C” are each intended to mean “A alone, B alone, C alone, A and B together, A and C together, B and C together, or A and B and C together.” Use of the term "based on" above and in the claims is intended to mean "based, at least in part, on" such that unrecited features or elements may also be permissible.
[0051] In view of the embodiments of the above subject matter, the present application discloses the following list of examples, wherein one feature of an individual example or a combination of more than one feature of the example, and optionally a combination with one or more features of one or more other examples, are other examples that also fall within the scope of the present application:
[0052] Example 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 for identifying each entry of the database cache; detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; in response 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; and notifying a cache manager that the given entry has been removed.
[0053] Example 2: The computer-implemented method of Example 1, further comprising executing a cache remove statement to remove a given entry of the database cache.
[0054] Example 3: The computer-implemented method of any of Examples 1-2, wherein the cache eviction statement includes a given entry_hash value.
[0055] Example 4: The computer-implemented method of any one of Examples 1-3 further includes: detecting modifications to one or more source tables; determining whether any database cache entries have become stale due to modifications to the one or more source tables; and generating a request to remove a given entry from the database cache in response to determining that the given entry has become stale due to modifications to the one or more source tables.
[0056] Example 5: The computer-implemented method of any of Examples 1-4, further comprising inserting a new entry into the database cache after removing the given entry.
[0057] Example 6: The computer-implemented method of any of Examples 1-5, further comprising optimizing execution of the query by accessing new entries of the database cache.
[0058] Example 7: The computer-implemented method of any of Examples 1-6, further comprising generating a new entry_hash value for a new entry in the database cache.
[0059] Example 8: The computer-implemented method of any of Examples 1-7, further comprising inserting the new entry_hash value into a new column of a corresponding row of a cache entry system view of the database cache.
[0060] Example 9: A system comprising: at least one processor; and at least one memory comprising program instructions that, 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 for identifying each entry of the database cache; detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; in response 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; and notifying a cache manager that the given entry has been removed.
[0061] Example 10: The system of Example 9, wherein the program instructions are further executable by the at least one processor to cause operations including executing a cache remove statement to remove a given entry of the database cache.
[0062] Example 11: The system of any of Examples 9-10, wherein the cache eviction statement includes a given entry_hash value.
[0063] Example 12: A system according to any of Examples 9-11, wherein the program instructions are also executable by at least one processor to cause operations including: detecting modifications to one or more source tables; determining whether any database cache entries have become stale due to modifications to the one or more source tables; and generating a request to remove a given entry from the database cache in response to determining that the given entry has become stale due to modifications to the one or more source tables.
[0064] Example 13: The system of any of Examples 9-12, wherein the program instructions are further executable by the at least one processor to cause operations comprising inserting a new entry into the database cache after removing the given entry.
[0065] Example 14: The system of any of Examples 9-13, wherein the program instructions are further executable by the at least one processor to cause operations including optimizing execution of a query by accessing a new entry of a database cache.
[0066] Example 15: The system of any of Examples 9-14, wherein the program instructions are further executable by the at least one processor to cause operations including generating a new entry_hash value for a new entry in the database cache.
[0067] Example 16: The system of any of Examples 9-15, wherein the program instructions are further executable by the at least one processor to cause operations comprising inserting a new entry_hash value into a new column of a corresponding row of a cache entry system view of a database cache.
[0068] Example 17: The system of any of Examples 9-16, wherein the program instructions are further executable by the at least one processor to cause operations comprising: in response to determining that a second search of the second cache for the first parameterized SQL view results in a hit, generating a query execution plan based on a query compilation tree previously generated for the received input query.
[0069] Example 18: A non-transitory computer-readable medium storing instructions that, when executed by at least one data processor, cause operations including: 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 for identifying each entry of the database cache; detecting a request to remove a given entry of the cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; in response 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; and notifying a cache manager that the given entry has been removed.
[0070] Example 19: The non-transitory computer-readable medium of Example 18, wherein the operations further comprise executing a cache remove statement to remove a given entry of the database cache.
[0071] Example 20: The non-transitory computer-readable medium of any of Examples 18-19, wherein the cache eviction statement includes a given entry_hash value.
[0072] The embodiments described in the foregoing description do not represent all implementations consistent with the subject matter described herein. Instead, they are merely some examples consistent with aspects related to the described subject matter. Although some variations have been described in detail above, other modifications or additions are possible. In particular, further features and / or variations may be provided in addition to those described herein. For example, the above implementations may be directed to various combinations and subcombinations of the disclosed features and / or combinations and subcombinations of several other features disclosed above. In addition, the logical flows depicted in the accompanying drawings and / or described herein do not necessarily require the specific order or sequential order shown to achieve the desired results. Other implementations may be within the scope of the appended claims.
Claims
1. A computer-implemented method comprising: Generates a system view of cache entries for the database cache; Generate a new column for the cache entry system view, where the new column is the entry_hash column used to identify each entry in the database cache; detecting a request to remove a given entry of a cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; In response to receiving the request, identifying a given entry of the database cache based on a given entry_hash value; removing the given entry from the database cache; and Notifies the cache manager that the given entry has been removed. 2 . The computer-implemented method of claim 1 , further comprising executing a cache remove statement to remove a 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.
4. The computer-implemented method of claim 1 , further comprising: Detect modifications to one or more source tables; determining whether any database cache entries have become stale due to modifications to the one or more source tables; as well as In response to determining that a given entry of the database cache has become stale due to modification of the one or more source tables, a request to remove the given entry is generated. 5 . The computer-implemented method of claim 1 , further comprising inserting a new entry into the database cache after removing the given entry.
6. The computer-implemented method of claim 5, further comprising optimizing execution of the query by accessing new entries of the database cache.
7. The computer-implemented method of claim 6, further comprising generating a new entry_hash value for a new entry in the database cache.
8. The computer-implemented method of claim 7, further comprising inserting the new entry_hash value into a new column of a corresponding row of a cache entry system view of the database cache.
9. A system comprising: at least one processor; and at least one memory including program instructions that, when executed by the at least one processor, cause operations comprising: Generates a system view of cache entries for the database cache; Generate a new column for the cache entry system view, where the new column is the entry_hash column used to identify each entry in the database cache; detecting a request to remove a given entry of a cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; In response to receiving the request, identifying a given entry of the database cache based on a given entry_hash value; Removes a given entry from the database cache; and Notifies the cache manager that the given entry has been removed.
10. The system according to claim 9, wherein: The program instructions are also executable by the at least one processor to cause operations including executing a cache removal statement to remove a given entry of the database cache.
11. The system according to claim 10, wherein: The cache removal statement includes the given entry_hash value.
12. The system according to claim 9, wherein: The program instructions are also executable by the at least one processor to cause operations including: Detect modifications to one or more source tables; determining whether any database cache entries have become stale due to modifications to the one or more source tables; and In response to determining that a given entry of the database cache has become stale due to modification of the one or more source tables, a request to remove the given entry is generated.
13. The system according to claim 9, wherein: The program instructions are also executable by the at least one processor to cause operations including inserting a new entry into the database cache after removing the given entry.
14. The system according to claim 13, wherein: The program instructions are further executable by the at least one processor to cause operations including optimizing execution of queries by accessing new entries of the database cache.
15. The system according to claim 14, wherein: The program instructions are further executable by the at least one processor to cause operations including generating a new entry_hash value for a new entry in the database cache.
16. The system according to claim 15, wherein: The program instructions are further executable by the at least one processor to cause operations including inserting a new entry_hash value into a new column of a corresponding row of a cache entry system view of the database cache.
17. The system according to claim 16, wherein: The program instructions are also executable by the at least one processor to cause operations including, in response to determining that a second search of the second cache for the first parameterized SQL view resulted in a hit, generating a query execution plan based on a query compilation tree previously generated for the received input query.
18. A non-transitory computer-readable medium storing instructions that, when executed by at least one data processor, cause operations comprising: Generates a system view of cache entries for the database cache; Generate a new column for the cache entry system view, where the new column is the entry_hash column used to identify each entry in the database cache; detecting a request to remove a given entry of a cache, wherein the request includes a given entry_hash value for locating the given entry of the database cache; In response to receiving the request, identifying a given entry of the database cache based on a given entry_hash value; Removes a given entry from the database cache; and Notifies the cache manager that the given entry has been removed.
19. The non-transitory computer-readable medium of claim 18, wherein: The operation also includes executing a cache remove statement to remove a given entry of the database cache.
20. The non-transitory computer-readable medium of claim 19, wherein: The cache removal statement includes the given entry_hash value.