How Does Athena Show a Query Execution Plan With Computational Cost?

Answer Correct answer: C — EXPLAIN ANALYZE SELECT * FROM sales; returns the Athena execution plan plus the computational cost of each operator.

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?

  1. EXPLAIN SELECT * FROM sales;
  2. EXPLAIN ANALYZE FROM sales;
  3. EXPLAIN ANALYZE SELECT * FROM sales; Correct Answer
  4. EXPLAIN FROM sales;

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question tests the difference between EXPLAIN (plan only) and EXPLAIN ANALYZE (plan plus per-operator runtime cost and rows processed), and the trap is choosing the plan-only form or breaking the syntax by dropping SELECT.

Amazon Athena's EXPLAIN ANALYZE statement returns both the distributed execution plan and the actual computational cost of every operator in a query. This page confirms that EXPLAIN ANALYZE SELECT * FROM sales; is the statement that satisfies both requirements, while plain EXPLAIN only shows the plan.

Candidates pick A, plain EXPLAIN SELECT * FROM sales, because it does produce an execution plan — but it never runs the query, so no computational cost per operation is reported.

Community Discussion (3 comments)

FunkyFresco 👍 5 Selected: C
use EXPLAIN ANALIZE https://docs.aws.amazon.com/athena/latest/ug/athena-explain-statement.html
HunkyBunky 👍 1 Selected: C
explain analyze + select * from table
tgv 👍 4 Selected: C
A - Only partially meets the requirements as it does not include computational costs. B - Incorrect syntax and does not meet the requirements. C - Fully meets the requirements by providing both the execution plan and the computational costs. D - Incorrect syntax and does not meet the requirements.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Amazon Athena supports EXPLAIN and EXPLAIN ANALYZE as prefixes to a SELECT statement. Plain EXPLAIN compiles the query and returns the logical/distributed plan without executing it, so it gives no runtime cost. EXPLAIN ANALYZE actually runs the query, then returns the execution plan annotated with metrics such as rows processed, bytes read and the CPU/wall time attributed to each operator — exactly the "computational cost of each operation" the engineer needs. The full statement therefore has to be EXPLAIN ANALYZE SELECT * FROM sales;, which keeps the SELECT keyword that Athena's parser requires.

Why the Other Options Are Wrong

Option A (EXPLAIN SELECT * FROM sales;) is syntactically valid and does return an execution plan, but because the query is not executed it cannot report computational cost, so it satisfies only half the requirement. Option B (EXPLAIN ANALYZE FROM sales;) drops the SELECT and is not valid Athena syntax, so it fails outright. Option D (EXPLAIN FROM sales;) has the same missing-SELECT syntax defect and, even if it parsed, would not include ANALYZE metrics. As tgv summarised in the thread, only C "fully meets the requirements by providing both the execution plan and the computational costs."

Community Comment Notes

Consensus in the comments is unanimous for option C, and FunkyFresco pointed learners directly at the Athena documentation page for the EXPLAIN statement. HunkyBunky restated the working form as "explain analyze + select * from table", reinforcing that the SELECT keyword must remain in place. The shared lesson is that the two keywords ANALYZE and SELECT are both mandatory for cost-level detail in Athena.

Official Reference

Exam Strategy

Memorise the pairing: EXPLAIN gives you the plan only, EXPLAIN ANALYZE gives you the plan plus real execution metrics and cost. When a question mentions cost, rows processed or per-operator statistics, the answer will contain ANALYZE and a complete SELECT statement.

Frequently Asked Questions

Why is plain EXPLAIN SELECT * FROM sales; not enough in Athena?

EXPLAIN only generates the execution plan without running the query, so it reports no per-operator computational cost or runtime statistics.

Why does EXPLAIN ANALYZE FROM sales; fail in Athena?

Athena requires EXPLAIN ANALYZE to prefix a full query, so the SELECT keyword is mandatory; without it the statement is a syntax error.

More DEA-C01 FAQ →

Related Analysis

Practice All DEA-C01 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DEA-C01 Practice Test →

← Back to DEA-C01 Study Guide