Skip to content

How do I resolve the "Query exhausted resources at this scale factor" Athena query error?

2 minute read
0

I ran an Amazon Athena query and received the "Query exhausted resources at this scale factor" error message.

Resolution

When the demands of the query exceed the resources that are available to the cluster that ran the query, you receive the following “out of resource" error:

"Query exhausted resources at this scale factor"

To resolve this issue, optimize your queries.

Reduce your data

To reduce the amount of data and evenly distribute the data that Athena scans, take the following actions:

Reduce your query statement

To reduce your query's memory usage, take the following actions:

Use EXPLAIN and EXPLAIN ANALYZE statements

Use EXPLAIN and EXPLAIN ANALYZE to analyze complex queries. The EXPLAIN statement shows the logical or distributed execution plan of a specified SQL statement. The EXPLAIN ANALYZE statement shows both the distributed execution plan of a specified SQL statement and the computational cost of each operation in your query.

If you use EXPLAIN and EXPLAIN ANALYZE statements, then take the following actions:

For more information, see EXPLAIN examples and Understand Athena EXPLAIN statement results.

Related information

Why do my Amazon Athena queries take a long time to run?

How do I resolve "Query Timeout" errors in Athena?

AWS OFFICIALUpdated 2 months ago