# A schedule referencing data from database is failing with errors like “Statement reached its statement or warehouse timeout of 600 second(s) and was canceled.”

**URL:** <https://community.exploratory.io/t/a-schedule-referencing-data-from-database-is-failing-with-errors-like-statement-reached-its-statement-or-warehouse-timeout-of-600-second-s-and-was-canceled/3840>\
**Category:** Issues\
**Created:** [December 30, 2024, 8:11am UTC](https://community.exploratory.io/t/a-schedule-referencing-data-from-database-is-failing-with-errors-like-statement-reached-its-statement-or-warehouse-timeout-of-600-second-s-and-was-canceled/3840 "2024-12-30T08:11:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user1](https://community.exploratory.io/user_avatar/community.exploratory.io/user1/32/11_2.png) [@user1](https://community.exploratory.io/u/user1)\
**Post date:** [December 30, 2024, 8:11am UTC](https://community.exploratory.io/t/a-schedule-referencing-data-from-database-is-failing-with-errors-like-statement-reached-its-statement-or-warehouse-timeout-of-600-second-s-and-was-canceled/3840/1 "2024-12-30T08:11:02Z")

</div>

A scheduled task that references data from the database is failing with errors such as:  
**“Statement reached its statement or warehouse timeout of 600 second(s) and was canceled.”**

To address this issue, consider reviewing and optimizing the SQL statement. Below are some suggestions for improvement:

- **Select only the necessary columns:** Avoid selecting unnecessary columns to reduce the query’s processing time and data volume.
- **Break down the query:** Split the query into smaller, more manageable datasets, and then join them later within Exploratory.

These steps can help reduce the query’s complexity and improve performance.
