Skip to content
Cloud Efficiency Hub

Unmanaged Growth of Athena Query Output Buckets

The short version

When a workgroup writes results to a customer-managed S3 location, Athena generates a new S3 object for every query result, regardless of whether the output is needed long term.

Abdeldjallil Koutchoukali

Lead Consultant FinOps @ Devoteam

AWS service
AWS Athena
Category
Storage
Reference
CER-0136
Type
Excessive Data Retention

Explanation

Why the waste happens and who it affects.

Over time, this leads to uncontrolled growth of the output bucket, especially in environments with repetitive queries such as cost and usage reporting. Many of these files are transient and provide little value once the query is consumed. Without lifecycle rules, organizations pay for unnecessary storage and create clutter in S3.

Billing model

The pricing dimensions that drive this cost.

Athena query execution is billed per terabyte of data scanned, but query results written to a customer-managed S3 output location are billed according to S3 storage pricing (Athena managed query results are kept for 24 hours at no charge). Each executed query produces an object in the output bucket, and costs accumulate as these objects persist over time without automated cleanup.

How to detect

5 checks to find it in your estate.

  • Review whether Athena query output buckets have lifecycle rules configured to delete or transition old objects
  • Check whether workgroups still use a customer-managed S3 output location rather than Athena managed query results
  • Assess growth trends in the S3 bucket size used for Athena outputs relative to actual business need
  • Check for repetitive or automated queries (e.g., CUR queries) that generate large volumes of transient results
  • Confirm whether audit, compliance, or reporting requirements justify long-term retention of certain outputs

How to fix

4 ways to remove the waste.

  • Implement S3 Lifecycle Policies on Athena output buckets to automatically expire objects after a set period (e.g., 30, 60, 90 days)
  • Switch workgroups that do not need long-term result retention to Athena managed query results, which need no customer S3 bucket, are stored at no cost for 24 hours and are then deleted automatically
  • Use prefixes or tags to differentiate between temporary query outputs and long-term reports, applying tailored retention rules
  • Regularly review and adjust retention policies to balance cost efficiency with business and compliance needs

Documentation

Vendor references for pricing and configuration.