Products · Developer platform
Basin SQL
Cloudflare's serverless, distributed query engine for data stored in Basin Catalog
Pricing and limits
Pricing
As of Nov 3, 2026, from Cloudflare's docs, last updated there Oct 1, 2026. Licensed CC BY 4.0; navigation removed.
Note
Basin SQL requires an active R2 subscription. Your account must also have a linked payment card.
Basin SQL charges based on a single dimension:
- Data scanned: The volume of compressed data read from R2 to execute your query.
Basin SQL pricing is additive to standard R2 storage and operations and Basin Catalog charges. When the query engine reads files, those requests count as R2 Class B (read) operations. R2 does not charge for egress, so there is no additional data transfer cost.
All included usage is on a monthly basis.
Basin SQL pricing
| Pricing | |
|---|---|
| Included | 10 GB / month |
| Data scanned | $0.0025 / GB ($2.50 / TB) |
What counts as data scanned
Data scanned is the compressed bytes read from R2 object storage to answer your query. This matches what you see in your R2 bucket — if a Parquet file is 100 MB on disk, scanning that file bills for 100 MB.
- Minimum per query: 10 MB. If a query scans less than 10 MB, you are billed for 10 MB.
- Failed queries: Queries that fail due to a system error or syntax error caught before execution are not charged. Queries that fail mid-execution due to a runtime error are also not charged.
- Metadata-only operations: Operations such as
EXPLAIN,SHOW, andDESCRIBEdo not scan data and are free. Standard R2 and Basin Catalog request charges still apply.
Billing examples
Example 1: Ad-hoc analytics on 500 GB of Parquet data
A user stores 500 GB of Parquet data in Basin Catalog and runs queries that scan a total of 50 GB of compressed data during the month.
| Dimension | Usage | Included | Billable | Cost |
|---|---|---|---|---|
| R2 storage | 500 GB-month | 10 GB-month | 490 GB-month | $7.35 |
| Basin SQL (data scanned) | 50 GB | 10 GB | 40 GB | $0.10 |
| Total | $7.45 |
Example 2: Heavy query workload on 10 TB dataset
A data team stores 10 TB of compressed Parquet/Iceberg data and scans 50 TB of data per month across their queries. The team also makes 2 million catalog operations with compaction processing 500 GB.
| Dimension | Usage | Included | Billable | Cost |
|---|---|---|---|---|
| R2 storage | 10,000 GB-month | 10 GB-month | 9,990 GB-month | $149.85 |
| Basin SQL (data scanned) | 50,000 GB | 10 GB | 49,990 GB | $124.98 |
| Basin Catalog operations | 2,000,000 | 1,000,000 | 1,000,000 | $9.00 |
| Basin Catalog compaction (data) | 500 GB | 10 GB | 490 GB | $2.45 |
| Total | $286.28 |
Frequently asked questions
Is there a minimum billing increment per query?
Yes. Each query is billed for a minimum of 10 MB of data scanned. This covers the overhead of initializing the query engine.
Does data scanned include R2 egress fees?
No. R2 does not charge for egress. The query engine runs within the Cloudflare network adjacent to R2 storage, so there are no data transfer costs.
Cloudflare billing policy
To learn more about how usage is billed, refer to Cloudflare Billing Policy.
Timeline
October 2026
- Basin SQL supports OFFSET
Basin SQL is a serverless, distributed SQL engine for querying Apache Iceberg tables in Basin Catalog. It now supports OFFSET, which lets you skip a specified number of rows when retrieving query results. Use LIMIT to set the page size and OFFSET to skip earlier rows. With a page size of 100, use OFFSET 0 for the first page, OFFSET 100 for the second, and increase the offset by 100 for each later…
- Cloudflare Basin is now generally available
Basin, formerly the Cloudflare Data Platform, is now generally available. Basin brings an end-to-end analytics platform to the Developer Platform, enabling you to collect data from a variety of sources, such as apps, infrastructure, devices, and other Cloudflare services, then query it to answer analytical questions. Basin Pipelines Basin Pipelines, formerly Cloudflare Pipelines, ingests events f…
August 2026
- Billing is now enabled for R2 SQL
Billing is now enabled for R2 SQL on non-enterprise accounts. R2 SQL usage beyond the included free tier will appear on your next invoice. R2 SQL charges based on a single dimension: Data scanned: $0.0025 / GB ($2.50 / TB) of compressed data read from R2 to execute your query. All plans include 10 GB of data scanned per month. Each query is billed for a minimum of 10 MB of data scanned. R2 SQL pr…
July 2026
- Query R2 Data Catalog tables with R2 SQL from the dashboard
You can now query your R2 Data Catalog tables with R2 SQL directly from the Cloudflare dashboard, without installing a CLI or wiring up a client. This makes it easy to explore your Apache Iceberg ↗︎ data, validate queries, and inspect results in one place. To get started, go to R2 Data Catalog ↗︎ in the Cloudflare dashboard and select Query data to launch the built-in SQL editor. From there you c…
June 2026
- R2 SQL now supports window functions, DISTINCT, and set operations
R2 SQL now supports window functions, SELECT DISTINCT, set operations, and additional aggregates, making it easier to write analytical queries without preprocessing your data elsewhere. R2 SQL is Cloudflare's serverless, distributed SQL engine for querying Apache Iceberg ↗︎ tables stored in R2 Data Catalog. New capabilities Window functions — ROW_NUMBER, RANK, DENSE_RANK, PERCENT_RANK, CUME_DIST,…
- R2 SQL now supports UNION, INTERSECT, EXCEPT, and SELECT DISTINCT
R2 SQL now supports set operations (UNION, INTERSECT, EXCEPT) and SELECT DISTINCT, expanding the range of analytical queries you can run directly on Apache Iceberg ↗︎ tables in R2 Data Catalog. Set operations Combine the results of multiple SELECT statements: UNION — returns all rows from both queries, removing duplicates UNION ALL — returns all rows from both queries, including duplicates INTERS…
May 2026
- R2 SQL pricing announced
R2 SQL is a serverless, distributed query engine that runs SQL against Apache Iceberg ↗︎ tables stored in R2 Data Catalog. R2 SQL now has published pricing based on a single dimension: the volume of compressed data scanned to execute your queries. At $2.50 / TB ($0.0025 / GB), R2 SQL is priced at half the cost of AWS Athena and less than half of Google BigQuery on-demand. Billing is not yet enabl…
- R2 SQL now supports JOINs, subqueries, and multi-table queries
R2 SQL is Cloudflare's serverless, distributed SQL engine for querying Apache Iceberg ↗︎ tables stored in R2 Data Catalog. R2 SQL runs directly on Cloudflare's global network with no infrastructure to manage, so you can analyze data in R2 without exporting it to an external warehouse. R2 SQL now supports joining multiple Iceberg tables in a single query. You can combine tables with JOINs, filter…
April 2026
- R2 SQL adds JSON functions, EXPLAIN FORMAT JSON, and unpartitioned table support
R2 SQL is Cloudflare's serverless, distributed, analytics query engine for querying Apache Iceberg ↗︎ tables stored in R2 Data Catalog. R2 SQL now supports functions for querying JSON data stored in Apache Iceberg tables, an easier way to parse query plans with EXPLAIN FORMAT JSON, and querying tables without partition keys stored in R2 Data Catalog. JSON functions extract and manipulate JSON val…
March 2026
- R2 SQL now supports over 190 new functions, expressions, and complex types
R2 SQL now supports an expanded SQL grammar so you can write richer analytical queries without exporting data. This release adds CASE expressions, column aliases, arithmetic in clauses, 163 scalar functions, 33 aggregate functions, EXPLAIN, Common Table Expressions (CTEs),and full struct/array/map access. R2 SQL is Cloudflare's serverless, distributed, analytics query engine for querying Apache I…
February 2026
- R2 SQL now supports approximate aggregation functions
R2 SQL now supports five approximate aggregation functions for fast analysis of large datasets. These functions trade minor precision for improved performance on high-cardinality data. New functions APPROX_PERCENTILE_CONT(column, percentile) — Returns the approximate value at a given percentile (0.0 to 1.0). Works on integer and decimal columns. APPROX_PERCENTILE_CONT_WITH_WEIGHT(column, weight,…
December 2025
- R2 SQL now supports aggregations and schema discovery
R2 SQL now supports aggregation functions, GROUP BY, HAVING, along with schema discovery commands to make it easy to explore your data catalog. Aggregation Functions You can now perform aggregations on Apache Iceberg tables in R2 Data Catalog using standard SQL functions including COUNT(*), SUM(), AVG(), MIN(), and MAX(). Combine these with GROUP BY to analyze data across dimensions, and use HAVI…
September 2025
- Announcing R2 SQL
Today, we are launching the open beta for R2 SQL: A serverless, distributed query engine that can efficiently analyze petabytes of data in Apache Iceberg ↗︎ tables managed by R2 Data Catalog. R2 SQL is ideal for exploring analytical and time-series data stored in R2, such as logs, events from Pipelines, or clickstream and user behavior data. If you already have a table in R2 Data Catalog, running…