# ERR Error executing GRAPH.QUERY: Query timed out after 10000 ms

- **ID:** `redis/redisgraph-query-timeout`
- **Domain:** redis
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

A RedisGraph query exceeded the configured timeout limit due to complex graph traversal, large result sets, or inefficient Cypher queries.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| RedisGraph 2.10.0 | active | — | — |
| Redis Stack 7.2.0 | active | — | — |
| RedisGraph 2.12.0 | active | — | — |

## Workarounds

1. **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.** (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.
   ```
2. **Use query profiling with GRAPH.EXPLAIN to identify bottlenecks, then break complex queries into smaller steps or use LIMIT to reduce result set size.** (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.
   ```
3. **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.** (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.
   ```

## Dead Ends

- **** — Increasing the timeout globally via GRAPH.CONFIG SET TIMEOUT may allow slow queries to run but can cause resource exhaustion or block other operations. (65% fail)
- **** — Removing all indexes to speed up writes actually slows down graph queries, making the timeout worse. (70% fail)
- **** — Restarting Redis clears the query cache but doesn't optimize the underlying query pattern, so the timeout will recur. (50% fail)
