Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable using cache results in Redshift Query?

I am interested in performance testing my query in Redshift.

I would like to disable the query from using any cached results from prior queries. In other words, I would like the query to run from scratch. Is it possible to disable cached results only for the execution of my query?

I would not like to disable cached results for the entire database/all queries.

like image 794
code Avatar asked Feb 21 '19 10:02

code


1 Answers

SET enable_result_cache_for_session TO OFF;

From enable_result_cache_for_session - Amazon Redshift:

Specifies whether to use query results caching. If enable_result_cache_for_session is on, Amazon Redshift checks for a valid, cached copy of the query results when a query is submitted. If a match is found in the result cache, Amazon Redshift uses the cached results and doesn’t execute the query. If enable_result_cache_for_session is off, Amazon Redshift ignores the results cache and executes all queries when they are submitted.

like image 193
John Rotenstein Avatar answered Oct 18 '22 21:10

John Rotenstein