Sourav Jha
Sourav Jha

Reputation: 411

Set result caching to off in redshift jdbc driver

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

Answers (1)

Joe Harris
Joe Harris

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

Related Questions