When running an Insights query, the query doesn't complete and an error message displays: "Canceling statement due to statement timeout"
The query timed out.
Queries time out after one minute. If the query takes too long to compile, the error displays. The warehouse itself doesn't experience timeouts and we can't increase the limit.
We recommend optimizing your queries to prevent timeouts by prioritizing:
- Selecting only necessary columns
- Filtering early
- Setting a row limit
- Splitting queries
Avoid the following:
- FULL OUTER JOINs
- Expensive operators
If your query is optimized and still timing out, consider running
EXPLAIN ANALYZEoperators on your query in the warehouse to identify bottlenecks.