R2 SQL: Serverless Query Engine

2026-01-27
R2 SQL
R2 SQLOpen Beta
Cloudflare

Serverless Query Engine

Query petabytes of data in R2 Data Catalog directly — no infrastructure to manage, no clusters to provision.

Distributed Execution

Queries run across Cloudflare's global network

Intelligent File Pruning

Uses Iceberg metadata to skip irrelevant data files

Edge-Native

Process data where it lives, not in centralized clusters

Free in Beta, Pay Per Query at GA

Only pay for the data you actually scan

Supported SQL Operations with more being added regularly
SELECTWHEREGROUP BYORDER BYLIMITCOUNTSUMAVGMIN / MAXHAVING
Terminal
$ npx wrangler r2 sql query "my-warehouse"
1SELECT
2 event_type,
3 COUNT(*),
4 AVG(duration_ms)
5FROM default.user_events
6WHERE event_time >= '2025-01-01'
7 AND user_id IS NOT NULL
8GROUP BY event_type
9ORDER BY COUNT(*) DESC
10LIMIT 10;
Query Result (3 rows, 0.42s)
event_typeCOUNT(*)AVG(duration_ms)
page_view1,245,83242.3
click892,45118.7
purchase156,234234.1