dataonaws
— Stack · Data

Amazon Athena

Serverless SQL over files in S3. You pay for the bytes scanned, so the way your files are laid out decides most of the bill.

How it fits

Athena reads your files where they are. Nothing is loaded.

SQL, BI, notebooksworkgroup, IAM roleSQLAMAZON ATHENAGlue Data Catalogschemas, partitionsPruningpartitions, columns, row groupsScan of S3the billed stepFederated connectors · Spark · result reuseS3 data lakeParquet, ORC, IcebergResults bucketevery result is a fileOther sourcesvia Lambda connectorsquery history + metrics → workgroup, CloudWatch
What it queries

One SQL engine over the lake and beyond.

Catalog tables

Files in S3

A table is a pointer: a schema, an S3 location and a format, read as-is at query time.

Open tables

Apache Iceberg

Athena reads the table's own metadata to plan, and the same tables stay readable by Spark, EMR or Redshift.

Federated

Databases, DynamoDB, logs

Connectors run as Lambda functions, so the query also bills Lambda on your account.

The three choices that matter

Most of the bill comes from here.

01

Which file format

Compressed columnar files let Athena read only the columns you ask for, billed on the compressed size.

02

How it is partitioned

Partition on the column your queries filter by most. A partition key the queries never use saves nothing.

03

How you pay

Per-scan pricing fits irregular use. Steady, heavy use is worth comparing with provisioned capacity or a warehouse.

What you pay

An Athena bill, in one line.

Data scanned
about $5 per TB
10 MB minimum per query; check your region
+
S3 requests
per GET
Grows with the number of files read
+
Catalog
Glue requests
Planning on large partitioned tables
+
Federation
Lambda
Connector run time
+
Results
S3 storage
Until a lifecycle rule deletes them
What we see in production
Dashboards running the same query every minute.Turn on query result reuse, or materialise once with CTAS.
Thousands of tiny files.Requests add up and pruning stops working; compact to a few hundred MB per file.
SELECT * on wide tables.Name the columns: Parquet only saves what you do not read.
How we help

Build & optimize your data platform on AWS

State of the art, costs under control. Most bills grow with habits, not with data.

Read the approach →
PDF · coming soon

The one-page Amazon Athena field guide.

Best practices, cost traps and performance checks, in the order you should run them. Printable, no fluff.

One email when the PDF is ready. Nothing else unless you tick the box.