How is Athena billed, and how do you cut its cost?
SQL queries are billed by bytes scanned, rounded up to the nearest megabyte with a 10 MB minimum per query.
Athena has three billing modes, and the one you choose decides how you cut cost.
1. On-demand SQL queries (the default). You pay for the data a query scans: USD 5 per TB in the US East (N. Virginia) pricing examples (the price differs by Region, so check the Athena pricing page). The scan is rounded up to the nearest megabyte, with a 10 MB minimum per query.
2. Provisioned capacity (Capacity Reservations). You reserve DPUs (Data Processing Units) and pay per DPU-hour (USD 0.30 in the pricing examples), whatever the queries scan. It suits steady, heavy workloads where predictable cost and dedicated capacity matter.
3. Athena for Apache Spark. Notebook and session workloads are billed per DPU-hour of compute used (USD 0.35 in the pricing examples), not by bytes scanned.
For SQL queries, cost falls when you scan less: store data as compressed Parquet, partition by the common filter and use partition projection for highly partitioned tables, select only needed columns, and use CTAS to write reusable results. Workgroups can limit how much data a query may scan.
- 1Billedper bytes scanned, 10 MB minimum
- 2Parquet + compressionfewer bytes
- 3Partitions or projectionskip data
- 4Select columnsonly what you need
- 5CTAS and workgroupsreuse results, cap scans
Key points
- bytes scanned
- Parquet + compression
- partitions / projection
- column selection
- workgroup limits
Common mistakes
- Running
SELECT *on wide tables and paying for every column. - Querying raw CSV or JSON instead of compressed, columnar Parquet.
- Partitioning data but filtering on a different column, so the whole table is scanned.
- Leaving many tiny files in a partition, which adds overhead and scan cost.
- Assuming Athena always bills by bytes scanned and ignoring provisioned capacity or Spark billing.
Best practices
- Convert data once to partitioned Parquet (or ORC) with CTAS and query the converted table.
- Select only the columns you need and always filter on the partition column.
- Use workgroups with a per-query data scan limit and track cost per team.
- For a steady, heavy query load, compare on-demand cost with provisioned capacity.
- Compact small files so that each partition holds fewer, larger files.
Likely follow-ups
- When does it make sense to switch from on-demand to provisioned capacity?
- What is partition projection and when do you use it?
- How does CTAS help reduce the cost of repeated queries?
- How do workgroups limit cost and separate teams?
- Why does columnar storage like Parquet scan fewer bytes?
References
- Amazon S3: data consistency model
- Amazon S3: performance guidelines
- AWS Glue: job properties and worker types
- AWS Glue: job bookmarks
- AWS Glue: DynamicFrame class
- AWS Glue: partitions and pushdown predicates
- AWS Glue: EventBridge events
- Amazon Athena: performance tuning
- Amazon Athena: partition projection
- Amazon Athena: pricing
- AWS Lambda: quotas
- AWS Lambda: asynchronous invocation error handling
- AWS Lambda: retry behaviour
- AWS Step Functions: error handling
- AWS Step Functions: Standard vs Express
- AWS Step Functions: AWS Glue integration
- Amazon DynamoDB: condition expressions
- AWS Secrets Manager
- AWS Systems Manager Parameter Store
- IAM: security best practices
- Amazon EMR: instance types and Spot best practices