Back to results for “Amazon Athena”
AWS › Amazon Athena

What are the performance considerations when running very large analytical queries in Athena?

Advanced

Answer

Since Athena is built on Presto and processes queries in a distributed manner, performance for very large queries benefits greatly from using compressed columnar formats like Parquet or ORC, partitioning data appropriately, avoiding small numbers of very large files by compacting them, and limiting the columns selected, since Athena has to scan and process every byte of data included in a query regardless of how it will ultimately be filtered.
SELECT customer_id, order_total FROM sales_parquet WHERE year = '2026' AND month = '09';
Real-world example A data team notices queries against thousands of tiny JSON files are extremely slow, so they run a compaction job to merge them into larger Parquet files, dramatically improving Athena query performance.

Common follow-ups: What is file compaction and why does it help Athena performance?;How does Athena's underlying Presto engine handle distributed query execution?