You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Redash查询缓存失效求助:自托管AMI版本Athena查询无缓存

Hey there, let's troubleshoot why your Athena queries aren't caching in your self-hosted Redash instance—even with default settings. I’ve run into similar issues before, so here are the key areas to check step by step:

1. Double-Check Redash's Core Cache Settings

Even though you mentioned default configs, it’s worth confirming these basics first:

  • Go to Admin > Settings in Redash. Look for the ENABLE_QUERY_CACHE toggle—make sure it’s set to true (this is default, but accidental changes happen). Also verify QUERY_CACHE_TTL (default is 900 seconds / 15 minutes); if it’s set to 0, caching will be disabled entirely.
  • For individual queries: Open the query editor, click the Settings button in the top-right, and check if Cache Results is enabled. By default this inherits the global setting, but it might have been manually toggled off for specific queries.
2. Rule Out Athena-Specific Query Variables

Redash’s cache works independently of Athena’s own result cache, but query structure can break both:

  • Athena treats queries as unique if they have dynamic values (like CURRENT_TIMESTAMP, random strings, or auto-generated parameters). If your query uses these, even small differences will make Athena re-run it—and Redash won’t cache results that change on every execution. Try replacing dynamic values with fixed ones temporarily to test if caching kicks in.
  • Note that some Athena query types don’t support its native cache (e.g., queries involving external tables, Lambda UDFs, or TABLESAMPLE). Even so, Redash should still cache the results it receives—unless the query returns different data every time.
3. Ensure the Cache Backend (Redis) is Working

The official Redash AMI uses Redis as the default cache backend—if it’s down or misconfigured, caching fails silently:

  • SSH into your Redash server and run redis-cli ping. If you get a PONG response, Redis is running. If not, restart it with sudo systemctl restart redis-server.
  • Check if Redash is actually writing to Redis: Run redis-cli keys "query_result:*". If you see a list of keys, caching is active; if empty, Redash isn’t connecting to Redis properly.
  • Verify the Redis URL in Redash’s config file (/opt/redash/.env). Look for REDIS_URL—it should point to your local Redis instance, like redis://localhost:6379/0. A wrong URL here breaks the cache connection.
4. Inspect Query Execution Logs for Cache Clues

Even if you didn’t see errors, dig deeper into worker logs for cache-related activity:

  • Run sudo journalctl -u redash-worker to view worker logs. Search for keywords like Caching query result or Using cached result. If you don’t see these lines, Redash isn’t triggering its caching logic at all.
  • Look for any subtle errors related to cache storage—maybe permissions issues with Redis, or a full Redis instance (though that’s less likely with default setups).
5. Check User-Level Cache Settings

It’s a long shot, but individual user settings can override global cache rules:

  • Have the affected user go to their Profile > Settings and check if Disable Query Cache is toggled on. This setting overrides global and query-specific cache rules for that user.

内容的提问来源于stack exchange,提问作者Nipun

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:08:22