‹ All DEA-C01 questions

DEA-C01 Practice Question 38: Athena Query Result Reuse

AWS Certified Data Engineer – Associate (DEA-C01) · Test 4 · question 8 of 10

Data Operations and Supporteasy

An executive dashboard runs the same six Athena SELECT statements every time it is opened, which happens roughly 40 times a day. The underlying tables are refreshed once an hour by an ETL job, so within any hour the six results are identical. The Athena bill is dominated by these repeated scans.

Which change reduces the scanned bytes with the least effort and no change to the dashboard's SQL?

Select one answer
Show answer and explanation

Answer:

  • C. Enable query result reuse for the dashboard's workgroup with a maximum result age of 60 minutes

Query result reuse is designed for precisely this pattern: "When you re-run a query in Athena, you can optionally choose to reuse the last stored query result. This option can increase performance and reduce costs in terms of the number of bytes scanned. Reusing query results is useful if, for example, you know that the results will not change within a given time frame." Athena looks for a previous execution of the same query string in the same workgroup and, if the stored result has not exceeded the maximum age you set, "bypasses execution and returns the query result from the previous, matching execution", no scan, no scan charge. A 60-minute maximum age lines up with the hourly refresh, and the dashboard's SQL is unchanged.

Option A works but is the expensive way to get there. Six CTAS statements per hour is 144 extra query executions a day plus a scheduler to operate, and the dashboard must be repointed at new table names.

Option B is the same idea with more moving parts: a Glue job to write and monitor, new output tables to catalog, and the dashboard rewired to read them.

Option D misunderstands what an Athena view is. A view is a stored query definition, not stored results; every reference to it re-runs the underlying scan, so the bytes scanned and the bill are unchanged. (Athena does not offer materialized views in the Redshift sense.)

Reference: Reuse query results in Athena

Practice Test 4 ›

Study guides for DEA-C01