Friday, April 16, 2021

Athena EXPLAIN


 Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run.

In any SQL code, EXPLAIN statement displays execution plans chosen by the optimizer for SELECT , UPDATE , INSERT , and DELETE statements. A statement execution plan is the sequence of operations that the database performs to run the statement.

This week, Amazon Athena introduced the support of the execution plan for the submitted 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. 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.

 Usage reference is at https://docs.aws.amazon.com/athena/latest/ug/athena-explain-statement.html

26 comments: