Posted On: Apr 8, 2021

Amazon Athena users can now view the execution plan for their queries. When querying large, complex datasets, users are often unaware of how their query will be executed or how optimizations will impact performance. Now generally available for Amazon Athena, the EXPLAIN statement helps users understand and improve the efficiency of their queries.

When used in the Athena console, the EXPLAIN statement provides a detailed breakdown of a query's execution plan. Users can analyze the execution plan to identify and reduce query complexity and improve run time. EXPLAIN can also be used to validate SQL syntax prior to execution. Doing so helps to prevent errors that would have occurred during execution.

Analysts are encouraged to use EXPLAIN when iterating on their queries. When EXPLAIN is used, Athena does not execute the underlying query. This allows analysts to tune their query without waiting for the results to be returned or incurring costs for data scanned.