PA Query cache usage - setUseCache

This page describes the setUseCache option available on PA (Datamart Context) queries and — more importantly — when it makes sense to turn it off. By default setUseCache is true, so every PA query is stored in and served from the shared PA result cache; calling setUseCache(false) opts a query out.

The direct effect on a single query is small — only around 1% of execution time is spent storing the result — so the real reason to care about this option is the side effect on other users of the system. The PA cache is FIFO and holds only about 1,000 entries. A heavy background job (data load, distributed Price List / CFS over millions of items, etc.) that fires many unique queries will quietly evict the cached results that dashboards and other interactive queries depend on, degrading UI performance for everyone else — without the job itself getting any benefit in return.

Rule of thumb:

  • Keep the default (true) when the same query is executed repeatedly — e.g., a distributed CFS loading reference data like a country list that recurs across batches.

  • Set false on heavy, one-shot queries inside background jobs where each item is unique: caching brings ~no benefit to the job itself, and you stop polluting the cache for the rest of the platform.

The decision is per-query, not per-context — within the same calculation you can have some queries cached and others not, depending on whether the result is reusable.

The page covers how to set the option, the recommended usage patterns above, and the side effects to be aware of (cache key sensitivity, FIFO eviction at ~1,000 entries, partition-level configuration).

⚠️ This use cache feature does not work with QueryAPI - PFUN-35172