如何在Redshift查询中禁用使用缓存结果? [英] How to disable using cache results in Redshift Query?

查看:250
本文介绍了如何在Redshift查询中禁用使用缓存结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对在Redshift中对查询进行性能测试感兴趣.

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.

推荐答案

SET enable_result_cache_for_session TO OFF;

来自 enable_result_cache_for_session-Amazon Redshift :

指定是否使用查询结果缓存.如果enable_result_cache_for_sessionon,则在提交查询时,Amazon Redshift将检查查询结果的有效缓存副本.如果在结果缓存中找到匹配项,则Amazon Redshift将使用缓存的结果,并且不会执行查询.如果enable_result_cache_for_sessionoff,则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.

这篇关于如何在Redshift查询中禁用使用缓存结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆