问题
I am doing testing against AWS Redshift, and to replicate real world scenarios I need my test queries to not be cached so as not to give a false picture of performance. Is there any way for me to clear the Redshift cache between query runs?
回答1:
I believe you can disable the cache for the testing sessions by setting the value enable_result_cache_for_session
to off
From the documentation
If enable_result_cache_for_session is off, Amazon Redshift ignores the results cache and executes all queries when they are submitted.
回答2:
As far as I know - you can't. But for performance reasons and 'real world performance', as you mentioned, you should simply discard initial runs and use performance indicators from subsequent runs against warm cache. That sounds more real world than running against cold cache, which gives you worst case scenario. If you insist on measuring cold cache performance, the simplest (although time consuming) solution is to reboot cluster after every cold run.
来源:https://stackoverflow.com/questions/37039150/clear-cache-on-aws-redshift