The cache mode defines whether and how the query results and navigational states calculated by the OLAP processor should be saved as highly compressed data in a cache.
The mode can be set as the default value for an InfoProvider in Customizing and for a query in the Query Monitor.
Caching is a means of improving query performance. Care should be taken to balance benefits against cost however:
You can store the cache data in the main memory, on an application server, or distributed in a network. The option that you choose depends on various parameters. These include:
We recommend saving queries that are requested very frequently in the cache. The main memory cache is very fast, but limited in size. By displacing cached data, you can cancel out main memory limitations, but this impairs system performance. There are practically no limitations on the memory space available in the database or in the file system for the persistent cache. Accessing compressed data directly in the persistent cache also improves performance.
Caching improves performance for queries whose evaluation is more complex. We recommend keeping complex data processed by the OLAP processor in the cache. (The Main Memory Without Swapping cache mode is therefore less suitable for this kind of query.)
The cache does not constitute an advantage if query-relevant data is frequently changed and therefore has to be loaded frequently, since the cache has to be regenerated every time. If cached data is kept in the main memory, data from queries that are called frequently can be displaced. It then takes longer to call the data.
Cache is Inactive (0)
The global cache is deactivated. The system then only works with the local cache. See OLAP Cache Monitor .
Cache Mode
If the global cache is activated, the following cache modes are available in the standard setting:
Main Memory Cache without Swapping, Cache Mode 1
The cache data is stored in the main memory. When the cache memory is exhausted, excess data is displaced according to the LRU algorithm, i.e. deleted from the memory. If the query is subsequently requested again, the result must be read from the InfoProvider once again.
Query Aggregate (or BLOB/Cluster Enhanced), Cache Mode 5
The cache data is persistent in database tables. In this mode, no data is displaced, and the memory size is unlimited. More space is required, but this method also saves time.
In most cases, we recommend using the standard query aggregate setting (cache mode 5).We only recommend using the main memory cache (cache mode 1) in cases where you want to save the data locally on the application server.
The following modes are provided merely in order to ensure compatibility if you have activated the corresponding cache administration parameter in the OLAP Cache Monitor:
Main Memory Cache with Swapping, Cache Mode 2
The cache data is stored in the main memory. When the cache memory is exhausted, the data to be displaced is written to background store and can be loaded back into the cache memory if there is another request.
The background store cannot be used any longer once query-relevant data has been loaded again.
Persistent Cache per Application Server, Cache Mode 3
The cache data is stored persistently as a database table or as a file in a directory that can be accessed from the application server. We recommend selecting a directory that is near to the application server.
Saving the cache data in a database table puts a heavy load on the database, but accessing cached data in the database is also significantly faster. In comparison to storing data in a star schema for example, fewer tables are read, and fewer indexes accessed.
Cross-Application Server Persistent Cache, Cache Mode 4
The cache data is stored persistently as a database table or cross-application server as a file in a file system in the network that can be accessed from the application server. In this mode, no data is displaced, and the memory size is unlimited. More space is required, but this method also saves time.
The table below provides an overview of cache modes 1-5:
Active Cache Modes
Property | Main Memory Cache | Query Aggregate | Main Memory Cache with Swapping | Persistent Cache per Application Server | Cross-Application Server Persistent Cache |
Cache Mode |
1 |
5 |
2 |
3 |
4 |
Displacement |
Yes (LRU algorithm and deletion) |
No |
Yes (LRU algorithm and displacement) |
No |
No |
Swapping |
No |
No |
Yes |
No |
No |
Global Cache Size |
Limited |
Unlimited |
Main memory limited, displaced part not limited |
Unlimited |
Unlimited |
Advantages of Cache Mode 5 Query Aggregate
The way in which data is processed and saved has fundamentally changed in this cache mode compared to the older cache modes mentioned above (cache modes 2-4). No lock concept is used. There is no central repository of cache elements. Thanks to its improved repository structure, cache mode 5 Query Aggregate solves known problems caused by enqueue locks. This renders the Persistent Cache per Application Server and Cross-Application Server Persistent Cache modes obsolete. At the same time, the performance of this cache mode is as good as with the main memory cache and is actually even better with a larger number of cache objects. Swapping is then no longer necessary.
Persistence Mode
Cache mode 5 Query Aggregate does not have its own persistence mode. Instead it automatically stores the cache entries with query data in a cluster table or a BLOB store (table with XSTRING area). More information: Cache Administration Parameters .
For cache modes 2-4, you can define how the displaced or cached data will be stored. You can find out more about persistence modes under Cache Parameters .
You can find additional information about the various ways of setting the cache mode for an InfoProvider or a query under Query Properties .
For more information about how OLAP caches work, about the cache parameters and the cache administration parameters, see OLAP Cache Monitor .