Start of Content Area

Object documentation Cache Mode Locate the document in its SAP Library structure

Definition

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.

Use

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. (Therefore the cache mode Main Memory Without Swapping is less suitable for such queries.)

      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.

Structure

The following modes are supported for the global cache:

...

       1.      Cache is Inactive (0)

The cross-transactional cache is deactivated.

The following modes are possible for the active cache: The cross-transactional cache is activated.

       2.      Main Memory Cache Without Swapping (1)

The cache data is stored in main memory. When the cache memory is exhausted, excess data is displaced according to the LRU algorithm, i.e. deleted from memory. If the query is subsequently requested again, the result must be read from the InfoProvider once again.

       3.      Main Memory Cache with Swapping (2)

The cache data is stored in 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.

Caution

The background store can no longer be used once query-relevant data has been loaded again.

       4.      Persistent Cache per Application Server (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 (see Structure linkInfoCube), fewer tables are read and fewer indexes are accessed.

       5.      Cross-Application Server Persistent Cache (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 not limited. 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.

       6.      BLOB/Cluster Enhanced (5)

The cache data is persistent in database tables. In this mode no data is displaced and the memory size is not limited. 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 way in which data is processed and saved has fundamentally changed in this cache mode compared to the cache modes specified above. No lock concept is used, and there is no central directory of cache elements.

Cache mode BLOB/Cluster Enhanced is not available by default. To be able to use this cache mode, you must activate the RSR_CACHE_ACTIVATE_NEW RSADMIN parameter; (VALUE=x).

For more information, see SAP Note 1026944.

The following table gives an overview of the available modes for an active cache:

Active Cache Modes

Property

Main Memory Cache

Persistent Cache

Without swapping

With swapping

Per application server

For all application servers

Displacement

Yes (LRU algorithm and deletion)

Yes (LRU algorithm and displacement)

No

No

Swapping

No

Yes

No

No

Global cache size

Limited

Main memory limited, displaced part not limited

Unlimited

Unlimited

File name

No

With swapping in flat files: The displaced data is located under the file name.

With flat file caches: All data is located under the file name. The application server is part of the file name.

With flat file caches: All data is located under the file name. The application server is not part of the file name.

For the active cache modes listed under 3-6 (Main Memory Cache with Swapping, Persistent Cache per Application Server, and Cross-Application Server), you can define how the displaced or cached data is to be stored. You can select the following persistence modes:

      Inactive: If you select this option, the system resets the cache mode to Main Memory Cache Without Swapping (1).

      Flat file: Storage in a file.

      Cluster Table: Storage in a non-transparent database table of type CLUSTER.

      Transparent Table (BLOB): Storage in a transparent database table with BLOB (Binary Large OBject).

Note

Compared to the Cluster Table, the Transparent Table (BLOB) leads to better system performance if you have large result sets. This is because fewer database operations have to be performed. With smaller result sets, the Cluster Table can be advantageous as BLOB fields require more administrative effort with regard to the database.

With these persistence mode settings, you can test which persistent storage gives the best performance in your system environment for each individual query.

If you do not define a persistence mode for the query, the persistence mode maintained as the default mode in Customizing is used for all the queries created for an InfoProvider.

Integration

You can find additional information about the various ways of setting the cache mode for an InfoProvider or a query under Query Properties.

You can find additional information about the global cache parameters and the memory requirements for the runtime object under OLAP Cache Monitor.

 

End of Content Area