Athena Cost Optimization

How to Reduce Amazon Athena Costs by Up to 90%

Amazon Athena is easy to use, but query costs can grow quickly when data in S3 is stored in CSV, JSON, or poorly optimized Parquet. The main way to reduce Athena cost is to reduce the amount of data scanned by each query.

Why Athena Queries Become Expensive

Athena charges based on the amount of data scanned by each query. If your data is stored inefficiently, Athena reads more data than necessary.

  • CSV and JSON files are usually larger than Parquet.
  • Uncompressed files increase scanned data.
  • Queries without partition filters scan too much data.
  • Too many small files can slow down queries.
  • Poor Parquet settings can reduce performance.

1. Convert CSV and JSON to Parquet

This is usually the biggest cost reduction opportunity. CSV and JSON are row-based formats. Athena often has to read much more data than your query actually needs.

Parquet is a columnar format. If your query needs only two columns, Athena can read only those columns instead of scanning the full dataset.

SELECT customer_id, order_date
FROM sales;

A 1 TB CSV dataset may become much smaller after conversion to compressed Parquet. In many cases, Athena scans only a fraction of the original data.

2. Compress Your Data

Compression reduces both S3 storage size and the amount of data Athena needs to scan. Common Parquet compression options include Snappy, ZSTD, GZIP, Brotli, and LZ4.

For Athena workloads, Snappy and ZSTD are often good choices because they balance compression ratio and query performance.

3. Partition Data Correctly

Partitioning helps Athena skip irrelevant folders. For example, instead of storing logs in one flat S3 location, you can organize them by year, month, and day.

s3://logs/year=2026/month=06/day=24/

Then queries can scan only the partitions they need:

SELECT *
FROM logs
WHERE year = 2026
  AND month = 06;

4. Avoid Too Many Small Files

Thousands of small files can increase query planning time and reduce performance. It is usually better to compact many small files into fewer, larger Parquet files.

For example, 5,000 files of 2 MB each are usually less efficient than a smaller number of larger optimized Parquet files.

5. Optimize Parquet Settings

Not all Parquet files are equally efficient. Settings such as compression codec, dictionary encoding, row group size, page size, and Parquet version can affect Athena query performance.

Different engines such as Amazon Athena, AWS Glue, Apache Spark, Trino, and Presto may benefit from different Parquet settings.

Example: Reducing Athena Cost

Before optimization:

  • Data format: JSON
  • S3 storage: 10 TB
  • Monthly Athena scans: 50 TB

After converting to optimized Parquet:

  • S3 storage: 2 TB
  • Monthly Athena scans: 5 TB
  • Lower storage cost
  • Faster Athena queries

How Parqify Helps

Parqify converts CSV and JSON files from Amazon S3 into optimized Apache Parquet. It also supports Parquet-to-Parquet optimization for existing datasets.

  • CSV to Parquet conversion
  • JSON to Parquet conversion
  • Parquet-to-Parquet optimization
  • Schema inference and schema customization
  • Built-in Athena optimization profile
  • Compression and Parquet settings
  • Parallel processing
  • Runs inside your AWS account

Conclusion

To reduce Amazon Athena costs, focus on reducing the amount of data scanned. Convert CSV and JSON to Parquet, compress files, use partitioning, avoid small files, and optimize Parquet settings.

These changes can reduce Athena query costs by 50%–90% while also improving query speed.