Reputation: 411
I am doing a performance test on redshift. Is there a way to turn off the result caching through JDBC driver. I have tried passing ("enable_result_cache_for_session", "off") as connection properties but it didn't work.
Upvotes: 1
Views: 740
Reputation: 14035
The session
referred to in this variable is all queries issued by a single connection. The setting does not apply to other connections and does not persist.
You have to issue SET enable_result_cache_for_session TO off;
in every connection. Many benchmarking tools or scripts create a new connection for every query they run.
UPDATE: I forgot that you can assign the setting to a user in a persistent way using ALTER USER
ALTER USER master SET enable_result_cache_for_session TO off;
-- ALTER USER
\q -- << disconnect then reconnect >>
SHOW enable_result_cache_for_session ;
-- enable_result_cache_for_session
-- ---------------------------------
-- off
Upvotes: 2