workerfuse

How a missing index can burn your Cloudflare D1 read quota

D1 bills and limits by rows read, not queries. A full table scan on every request adds up fast. Some math, and how to catch it.

D1 bills rows read and written, not queries. That sounds like a detail until a query without an index scans the whole table on every request.

Say you have a 1M row table and a lookup on a column with no index. Each call reads 1M rows. At 10 requests per second, that's 864,000 calls a day, or about 864 billion rows read. At $0.001 per million rows that's around $864 a day at list price, before the Paid plan's 25 billion rows a month allowance. For one missing index. Wild.

On the Free plan it fails differently. The daily read limit is account-wide, so one bad Worker eats the quota and D1 breaks for every other Worker in the account. Your bill stays at $0 and everything is down, which is maybe worse.

How to catch it

  • Run EXPLAIN QUERY PLAN on your hot queries. If you see SCAN instead of SEARCH ... USING INDEX, that's the one.
  • D1 returns meta.rows_read with each result. Log it for a day, the outliers jump out.
  • Watch rows read per database in the D1 analytics, not just query count.

workerfuse can pause a Worker once reads across its bound D1 databases pass a daily cap. I added that mostly for the Free plan case, where your invoice stays at $0 but the quota is what actually hurts. Fair warning: it checks every five minutes, so a scan loop this fast can still eat the free quota first. And a shared database counts against every script bound to it.

Pause the runaway Worker. Keep the rest running.

workerfuse checks your Cloudflare spend every five minutes and pauses any Worker over its limit.

Start free trial

Keep reading

Cloudflare spending limits vs pausing one Worker

Cloudflare now has spending limits for Workers and Durable Objects. They're account-wide and block the whole product. Here's how that compares to pausing only the runaway Worker.

Cloudflare billing horror stories: four runaway bills from 2026

A $34,895 alarm loop, a $10,811 bill from an abandoned side project, a ~$36,000 queue loop, and $4,586 of D1 writes. What broke, how long it ran, and what Cloudflare did about it.

How a Durable Objects alarm loop runs up your Cloudflare bill

A Durable Object alarm that keeps rescheduling itself racks up requests, storage writes and duration. What that costs at list price, and how to stop it.