Medium severitydbt
Power BI Refresh Error:
Query Timeout / Statement Timeout
What does this error mean?
A dbt model's SQL query exceeded the configured statement timeout in the warehouse and was cancelled. The model is marked as failed and downstream dependencies do not run.
Common causes
- 1A model performs a full table scan on a very large table without appropriate clustering, partitioning, or pruning
- 2The warehouse virtual cluster is undersized for the query complexity (too small a compute cluster for the data volume)
- 3An incremental model is doing a full merge instead of a filtered merge, causing the merge predicate to scan all existing rows
- 4Cross-database joins or external table scans are much slower than expected
- 5The query was waiting in a warehouse queue for too long before execution started, consuming available timeout budget
How to fix it
- 1Check the warehouse query history for the failed query — look at the query plan to identify full table scans or missing join filters.
- 2For incremental models, ensure the merge predicate is filtered: add a `where` clause on the incremental model to only scan recent source rows.
- 3Increase the warehouse size (compute cluster) temporarily to determine whether the model succeeds with more resources.
- 4Add clustering keys or partition pruning to the large source tables the model scans.
- 5Split the model into smaller steps using intermediate models if the transformation is too complex for a single query.
Frequently asked questions
Official documentation: https://docs.getdbt.com/guides/debug-errors