DEA-C01 · Question #99
A data engineer wants to improve the performance of SQL queries in Amazon Athena that run against a sales data table. The data engineer wants to understand the execution plan of a specific SQL…
The correct answer is C. EXPLAIN ANALYZE SELECT * FROM sales. In Athena (which uses the Presto/Trino engine), EXPLAIN shows the logical and physical execution plan for a query but does not include runtime statistics. EXPLAIN ANALYZE actually executes the query and returns the execution plan annotated with real computational cost metrics…
Question
A data engineer wants to improve the performance of SQL queries in Amazon Athena that run against a sales data table. The data engineer wants to understand the execution plan of a specific SQL statement. The data engineer also wants to see the computational cost of each operation in a SQL query. Which statement does the data engineer need to run to meet these requirements?
Options
- AEXPLAIN SELECT * FROM sales;
- BEXPLAIN ANALYZE FROM sales;
- CEXPLAIN ANALYZE SELECT * FROM sales;
- DEXPLAIN FROM sales;
How the community answered
(25 responses)- A8% (2)
- B4% (1)
- C76% (19)
- D12% (3)
Explanation
In Athena (which uses the Presto/Trino engine), EXPLAIN shows the logical and physical execution plan for a query but does not include runtime statistics. EXPLAIN ANALYZE actually executes the query and returns the execution plan annotated with real computational cost metrics - rows processed, data read, CPU time, and wall time for each operator. The correct syntax requires a full SQL statement: EXPLAIN ANALYZE SELECT * FROM sales;. Option A (EXPLAIN SELECT * FROM sales) shows the plan but not the runtime costs. Options B and D have invalid syntax - EXPLAIN ANALYZE requires a full SELECT statement, and EXPLAIN alone with just FROM is not valid SQL.
Topics
Community Discussion
No community discussion yet for this question.