'Redshift - use cached query plan
We are running the same queries with different filter values from Qlik Sense client application. There is a lot of concurrency there as we are talking about a lot of customers that run the same report. But we are talking about the exact same set of predefined queries. The distribution of data does not change, only the volume increases. These queries usually retrieve data from both local Redshift DB (dimensions) which join with S3 data (via Spectrum). The # of Redshift Materialized Views is very small, and both these MVs as well as the External Database (pointing to S3) refresh very often (~every 15 minutes).
I managed to get all queries to run under 2s which is great! But the biggest challenge I am having is that too often does it re-generate the query execution plan, instead of using the one that's been cached. This increases the execution time from ~2s to more than 10 seconds.
I would like to know if there is any way to force the usage of the cached query plan, as much as possible.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
