# Error 3024: Query execution was interrupted, maximum statement execution time exceeded

| Error Code | SQLSTATE | Error              | Description                                                                |
| ---------- | -------- | ------------------ | -------------------------------------------------------------------------- |
| 3024       |          | ER\_QUERY\_TIMEOUT | Query execution was interrupted, maximum statement execution time exceeded |

## Possible Causes and Solutions

The cause is that the executing statement took more than [max\_statement\_time](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#max_statement_time) (primary) or [slave\_max\_statement\_time](https://mariadb.com/docs/server/ha-and-performance/standard-replication/replication-and-binary-log-system-variables#slave_max_statement_time) (replica) to execute.

To fix this, you have to either increase the value of [max\_statement\_time](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables#max_statement_time) or find out [why the query is slow](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations). Start by doing an [EXPLAIN](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/explain) or [ANALYZE](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/analyze-statement) on the query to find out how the query is executed.

## See Also

* [Aborting Statements that Exceed a Certain Time to Execute](https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/aborting-statements)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
