Monitor and Manage the Cache

To manage the changes in the underlying databases and to monitor cache entries, you must develop a cache management strategy.

You need a process to invalidate cache entries when the data in the underlying tables that compose the cache entry changes, and a process to monitor, identify, and remove any undesirable cache entries.

This section contains the following topics:

How Semantic Model Changes Affect the Query Cache

When you modify the semantic model (.rpd file), the changes can have implications for entries that are stored in the cache. For example, if you change the definition of a physical object or a dynamic variable, cache entries that reference that object or variable might no longer be valid. These changes might result in the need to purge the cache. There are two scenarios to be aware of: when you make changes, and when you're switching between semantic models.

Making Changes to the Semantic Model

When you modify a semantic model, any changes that you make that affect cache entries automatically result in a purge of all cache entries that reference the changed objects. The purge occurs when you check-in the changes. For example, if you delete a physical table from a semantic model, then all cache entries that reference that table are purged upon check in. Any changes made to a business model in the Business Model and Mapping or Logical layer purge all cache entries for that business model.

Switching Between Semantic Models

If you intend to remove a semantic model from the configuration of the BI Server, then ensure that you purge the cache of all cache entries that reference the semantic model. Failure to do so results in a corrupted cache.

Changes to Dynamic or Global Semantic Model Variables

The values of dynamic or global semantic model variables are refreshed by data that's returned from queries. When you define a dynamic or global semantic model variable, you create an initialization block or use a preexisting one that contains a SQL query. You also configure a schedule to run the query and periodically refresh the value of the variable.

If the value of a dynamic or global semantic modeler variable changes, then any cache entry which uses this variable in a column becomes stale, and a new cache entry is generated when data in that entry is needed again. The old cache entry isn't removed immediately, but remains until it is cleaned through the usual caching mechanism.