Skip to content

Cloudflare D1 caps query results at 50MB from 4 November

Queries that return more than 50MB will start failing with a dedicated error. Cloudflare says it only affects the top 0.001% of requests, but large exports and unbounded SELECTs are the ones that will break.

Source: Cloudflare

Cloudflare will start enforcing a maximum query result size of 50MB on D1 from 4 November. Any query that returns more than that will fail with: “D1 query result exceeded the maximum response size limit of 50 MB.”

Cloudflare says this covers the 99.999th percentile of requests, so most D1 users will not notice. Import and export operations through the REST API are exempt. The fix for anything that does hit the cap is the usual one: select only the columns you need instead of SELECT *, and paginate large result sets with LIMIT and OFFSET rather than pulling everything in one query.

SELECT id, name, created_at FROM orders
ORDER BY id
LIMIT 1000 OFFSET 0;

Why it matters: D1 is Cloudflare’s serverless SQLite, and a handful of days’ notice is tight if you have a report, export or admin query that quietly grew past 50MB. Worth running your biggest SELECT * queries now, before 4 November turns them into errors in production.

Share

Related reading

More from The Wire

All briefs