The query cache setting can be set for a given query to govern if the queries launched from the specific Discover report are cached on Pyramid's servers or not. The main purpose of caching is to accelerate the re-use of the same query result set without re-querying the underlying data source for the exact same results.
There are 3 choices for caching:
- Model Defaults: The Discover caching options are driven by the settings applied to the underlying data model. These are set in the admin console or in the model definition.
- Disable Cache: Any queries executed from this report will always re-query the underlying data source - ignoring the cached results.
- Enable Cache: Any queries executed from this report will avoid re-querying the underlying data source - using the cached results if they exist.
The caching mechanism does NOT store the query result permanently. Instead, it is held in memory in the event the exact same query is required in the future. Since there are numerous complications with such a mechanism, there are many aspects of the platform that govern if and how queries are cached,
- The amount of time a query is held in cache, if enabled, is determined in the admin console. If the query cache setting is turned to "0" in the admin console, the cache is effectively turned off globally.
- The cache is held in memory. If the server's memory starts reaching limits, queries may be released from cache earlier than the specified time in the admin.
- If the data source is secured by user, the cache stores query results by user. So the same query executed by different users will not overlap in the cache.
- For data models designed in Pyramid, its possible to determine the default caching mode to use for all queries run against it. By default, caching is enabled in all Pyramid models. and by default, the cache settings in Discover reflect the settings made in the data model. For non Pyramid models (MS OLAP, Tabular, SAP BW and Hana), its possible to control the caching of results from the data source manager.When using the "model Default" described above, this setting will apply.
Query Cache in Present and Publish
Any queries included in Present and Publish reflect the settings made in Discover for the content. There is an option in Present to ignore cache settings as well.