Jorge Turbica / blog · Blog ← All articles ES · Leer en español
Cloud

Athena swaps terabytes scanned for DuckDB milliseconds: up to 50% cheaper

Athena previews a DuckDB engine billed at $0.35 per DPU-hour instead of $5/TB. What it saves, how to enable it and where it can cost more.

A million small queries a month cost $24.30 on Athena with DuckDB and $50 on the classic engine, which bills a 10 MB minimum per query. Since December 1, 2026, Amazon Athena has a second SQL engine in preview, built on DuckDB, that bills for the compute each query uses instead of the terabytes it reads — and AWS claims up to twice the speed and up to 50% lower cost on queries of 100 GB or more.

What changes

Athena engine version 3 (Trino-based) stays as it was: $5 per TB scanned with a 10 MB minimum per query, or Capacity Reservations. The DuckDB engine is chosen per workgroup and costs $0.35 per DPU-hour, billed per millisecond with a 100 ms minimum. It also brings:

  • DuckDB Scales: splits a large query across several DuckDB servers and merges the results, while everyday queries stay on a single server. AWS will open-source it in 2027.
  • Apache Iceberg v3 tables, a streaming API over Apache Arrow with an ADBC driver, and a DuckDB extension so you can write SQL locally and run it on Athena when it outgrows your laptop.
  • Preview regions: N. Virginia, Ohio, Oregon, Ireland and Tokyo.

The backstory explains the bet: DuckLabs, the team that created DuckDB, is now part of AWS and still leads the open source project. AWS says DuckDB is coming to EMR and Redshift through 2027.

What it costs in practice

Using the examples on the pricing page itself:

QueryDuckDB engineEngine v3 (per TB)
Small-table lookup: 0.25 DPU for 1 s$0.0000243$0.00005 (10 MB minimum)
1,000,000 lookups a month$24.30$50
One year of sales in Parquet: 4 DPU for 2 s$0.00078depends on bytes scanned
Query reading 100 GBdepends on runtime$0.50

That last row's $0.50 buys 1.43 DPU-hours on DuckDB: a 4-DPU query would have to run for over 21 minutes to cost more. For workloads that read a lot and compute little, the new pricing model clearly favors DuckDB.

How to turn it on

In the console: Administration → Workgroups → Create workgroup, then pick DuckDB under Athena engine version. With the CLI, per the Athena user guide:

bash
aws athena create-work-group \
  --name analytics-duckdb \
  --configuration '{ "EngineVersion": { "SelectedEngineVersion": "DuckDB" } }' \
  --region eu-west-1

Then point your queries at that workgroup (--work-group analytics-duckdb on aws athena start-query-execution).

Gotchas and edge cases

  • Automatic selection never picks DuckDB. A workgroup with no pinned version, or on automatic, stays on engine version 3; you have to ask for DuckDB explicitly.
  • Service-linked role. The account's first DuckDB workgroup creates AWSServiceRoleForAmazonAthena, so whoever creates it needs iam:CreateServiceLinkedRole — or an admin can create it upfront with aws iam create-service-linked-role --aws-service-name ops.athena.amazonaws.com.
  • Settings the API rejects: customer content encryption, IAM Identity Center, S3 Access Grants for results, an execution role and MonitoringConfiguration. If your current workgroup uses any of them, you can't just flip it to DuckDB.
  • Federated queries (the ones that invoke Lambda) remain engine version 3 only.
  • The risk flips. Under per-TB pricing, reading too much was what hurt; with DuckDB, computing too much is. A query that reads little but grinds through heavy joins for minutes can end up costing more than before. Measure a handful of real queries on the new engine before moving a workgroup that feeds dashboards or agents.

If you already use DuckDB locally, the Athena extension is the most interesting piece: the same SQL on your laptop and over S3, with no Trino translation.

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗