Cache Mode
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.
You can define the respective mode for an InfoProvider as the standard value in Customizing and for a query in the Query Monitor.
Caching is a means of improving query performance. However, care should be taken to balance benefits against cost:
● Benefit: Caching improves the response time for queries
● Cost: Expenditure involved in organizing and retaining data in the cache
You can keep the cache data in main memory, on an application server, or distributed in a network. The option that you choose depends on various parameters. These include:
● How often the query is requested
We recommend that you save queries that are requested very frequently in the cache. Main memory cache is very fast, but limited in size. By displacing cached data, you can cancel out main memory limitations, but this also affects 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.
● The complexity of the query
Caching improves performance for queries whose evaluation is more complex. We recommend that you keep 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.)
● How often data is loaded
The cache does not provide 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 main memory, data from queries that are called frequently can be displaced, so that calling the data takes more time.
...
Cache is Inactive (0)
The global
cache is deactivated. The system then only works with the local cache. See
OLAP Cache
Monitor.
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.
○ Database table: The database instance for the table carries the load.
○ With both storage types, the application server that calculates the data and network communication have to be taken into account.
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 can no longer be used 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 that you select 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 for example a star schema (more information:
Star Schema),
fewer tables are read and fewer indexes are 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.
○ Database table: The database instance for the table carries the load.
○ File: The operating system of the network node for the file carries the load.
○ With both storage types, the application server that calculates the data and network communication have to be taken into account.
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.
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.