redis
runtime_error
ai_generated
partial
ERR Error executing GRAPH.QUERY: Query timed out after 10000 ms
ID: redis/redisgraph-query-timeout
75%Fix Rate
82%Confidence
1Evidence
2024-05-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| RedisGraph 2.10.0 | active | — | — | — |
| Redis Stack 7.2.0 | active | — | — | — |
| RedisGraph 2.12.0 | active | — | — | — |
Root Cause
A RedisGraph query exceeded the configured timeout limit due to complex graph traversal, large result sets, or inefficient Cypher queries.
generic中文
由于复杂的图遍历、大型结果集或低效的 Cypher 查询,RedisGraph 查询超过了配置的超时限制。
Official Documentation
https://redis.io/docs/latest/commands/graph.query/Workarounds
-
80% success Optimize the Cypher query by adding indexes on frequently filtered properties: GRAPH.QUERY mygraph 'CREATE INDEX ON :Person(age)', then rewrite queries to use indexed properties in WHERE clauses.
Optimize the Cypher query by adding indexes on frequently filtered properties: GRAPH.QUERY mygraph 'CREATE INDEX ON :Person(age)', then rewrite queries to use indexed properties in WHERE clauses.
-
75% success Use query profiling with GRAPH.EXPLAIN to identify bottlenecks, then break complex queries into smaller steps or use LIMIT to reduce result set size.
Use query profiling with GRAPH.EXPLAIN to identify bottlenecks, then break complex queries into smaller steps or use LIMIT to reduce result set size.
-
70% success Increase the timeout for specific queries by setting a higher TIMEOUT value in the GRAPH.QUERY command, e.g., GRAPH.QUERY mygraph 'MATCH ...' --timeout 30000.
Increase the timeout for specific queries by setting a higher TIMEOUT value in the GRAPH.QUERY command, e.g., GRAPH.QUERY mygraph 'MATCH ...' --timeout 30000.
中文步骤
通过添加索引优化 Cypher 查询:GRAPH.QUERY mygraph 'CREATE INDEX ON :Person(age)',然后重写查询以在 WHERE 子句中使用索引属性。
使用 GRAPH.EXPLAIN 进行查询分析以识别瓶颈,然后将复杂查询分解为更小的步骤或使用 LIMIT 减少结果集大小。
通过在 GRAPH.QUERY 命令中设置更高的 TIMEOUT 值来增加特定查询的超时,例如:GRAPH.QUERY mygraph 'MATCH ...' --timeout 30000。
Dead Ends
Common approaches that don't work:
-
65% fail
Increasing the timeout globally via GRAPH.CONFIG SET TIMEOUT may allow slow queries to run but can cause resource exhaustion or block other operations.
-
70% fail
Removing all indexes to speed up writes actually slows down graph queries, making the timeout worse.
-
50% fail
Restarting Redis clears the query cache but doesn't optimize the underlying query pattern, so the timeout will recur.