billflare.

Database indexes · Content tag

Browse content discussing database indexes.

36 matching items

Cases · 11

D1

hiromsaeden: an unindexed D1 query loop billed $2,129.00; a $953.74 courtesy credit left $645.38 due.

Cloudflare Community user hiromsaeden, in a post-mortem of a personal hobby project on Workers and D1, says an unindexed GROUP BY aggregate query scanned about 877,000 rows to return 30 rows, and an unintended loop triggered about 315,000 runs across two billing cycles. In the Oct 15 – Nov 15 cycle alone, 1,447,580,203,670 rows (1.44 trillion rows) were read, on top of the previous cycle’s usage. The author says the October invoice IN-83890481 was $529.88 USD, paid in full out of pocket; the November invoice IN-89082487 was $1,599.12 USD ($1,447.58 D1 Rows Read + $6.16 Workers CPU + $145.38 tax); and the total billed was $2,129.00 USD against an expected budget of about $20/month. After noticing the issue on Nov 2–3, the author deleted the Worker and the D1 database; Support confirmed all reads had stopped. In case #02408621, Support offered a $275.00 courtesy credit for October and advised holding it until the November invoice was issued on Nov 15. In case #02434399, Support applied a one-time courtesy credit of $953.74 (which included the held $275.00), leaving a final balance of $645.38 USD, and said the review was complete and no further adjustments can be made. The author, having already paid $529.88, says the remaining $645.38 cannot be afforded and the account will be downgraded on Nov 22. The author also says a budget alert fired once at the $37 mark but did not stop the charges, and that D1 currently has no hard spending cap. There is no Cloudflare staff reply on the public thread; the Support actions are reported by the author.

Reported amount · USD

$2,129

Reported cause: Unbounded loopcommunity.cloudflare.com
First reported: Latest update:
Workers

BowTied SaaS Guy: a $4,950 Cloudflare bill with $2,000 credited.

BowTied SaaS Guy (@BowTiedDolphin) says he ran up a $4,950 bill on Cloudflare and was credited $2,000 because no notifications were sent for the amount above $200. In a reply he says he upgraded after hitting free-plan limits and that another Worker’s usage skyrocketed because of a poor index on a public website.

Reported amount · USD

$4,950

Reported cause: Unknownx.com
First reported: Latest update:
D1

A missing D1 index made every lookup scan a 306,000-row table, a four-figure invoice with no budget alert.

Community user stefanr0sca, who relies on an AI coding assistant, says a missing index made every lookup scan a 306,000-row table and produced a four-figure invoice; the exact amount is not given. He says the $10 budget alert created automatically when he upgraded showed $0.00 for the whole cycle and never sent a notification, that the support case was closed automatically after a decision was promised, and that he could not reopen it or open a new one.

Reported amount · USD

Not disclosed

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:
D1

An unindexed D1 query produced a $100.90 rows-read overage.

Community user jaime.ruiz.pallares says an unindexed query in their own code caused a $100.90 D1 Rows Read overage on a $105.90 invoice dated August 13, 2026, already paid. The Billing support form appeared to end at a Back button; after an MVP pointed out that all suggested-article dropdowns must be expanded, the author opened a billing case to request a one-time goodwill credit.

Reported amount · USD

$100.90

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:
D1

A missing index on a D1 DELETE read about 4 trillion rows, a $4,114.97 charge.

Community user user11226 says a missing database index made a DELETE operation repeatedly scan the table, generating about 4.03 trillion D1 rows read in the billing period and an unexpected $4,114.97 bill on what they understood to be a $5-a-month subscription. In follow-ups they accept they should have configured billing alerts, say Cloudflare successfully challenged their chargeback while the urgent billing case took more than three weeks to get a response, and ask for someone to review the circumstances.

Reported amount · USD

$4,114.97

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:
D1

Full-table scans on D1 produced $564.23 in usage for one cycle.

Community user need1026 says a hot-path query that full-scanned a large table without an index drove the May 13 to June 12, 2026 cycle to $564.23 of billable usage, almost all D1 Rows Read ($562.84). The author added the missing indexes on June 5 and asks for a one-time credit before the invoice is finalized.

Reported amount · USD

$564.23

per month

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:
D1

D1 row reads: a $134.14 invoice from unindexed queries.

Justin Ahinon reports that his April 21, 2026 Cloudflare invoice was $134.14, with $127.60 from 127,599,130,859 D1 row reads on a 765,000-row database. He attributes it to full table scans in queries that ran on every page load.

Reported amount · USD

$134.14

Reported cause: Read volumefullstacksveltekit.com
First reported: Latest update:
D1

contact.freeicon: inefficient D1 queries produced about $748 in four days.

Community user contact.freeicon, running a non-profit free icon library on cloudflare-icon.pages.dev, reports unexpected D1 charges of about $748 from April 13–17, 2026 after a LEFT JOIN GROUP BY query scanned about 6.4 million rows on every page request and bot crawling drove about 200 billion reads. The author replaced the query with a pre-computed indexed column and 72-hour KV caching.

Reported amount · USD

$748

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:
D1

6.3 trillion D1 row reads in one day led to a $6,781 charge and a billing dispute.

Community user markbooth63, a solo developer on Pages and D1, says a coding bug ran a full table scan on every API request on April 7, 2026, causing 6.3 trillion D1 row reads in a few hours and a $6,781 invoice. He says he fixed it and filed a billing dispute the same day, added an index, and that after 10 days without a response the balance was reduced to $6,357 with no explanation.

Reported amount · USD

$6,781

Reported cause: Read volumecommunity.cloudflare.com
First reported: Latest update:

Guides · 25

GuideD1Workers

hiromsaeden: an unindexed D1 GROUP BY loop produced $2,129.00 in invoices on a hobby project

On 2026-11-18, Cloudflare Community user @hiromsaeden published a post-mortem of a personal hobby project. An unindexed GROUP BY aggregate query scanned about 877,000 rows to return 30 rows; an unintended loop triggered about 315,000 runs across two billing cycles. In the 15 October–15 November cycle alone, 1,447,580,203,670 rows (1.44 trillion rows) were read. Invoice IN-83890481 was $529.88 USD (paid). Invoice IN-89082487 was $1,599.12 USD ($1,447.58 D1 Rows Read + $6.16 Workers CPU + $145.38 tax). Total billed was $2,129.00 USD; the expected budget was about $20/month. Support cases #02408621 and #02434399 led to a one-time courtesy credit of $953.74 (including a held $275.00), leaving a final balance of $645.38 USD; support said no further adjustments would be made. These amounts are the author’s invoices and credits, not a Billflare case total in this guide.

GuideD1R2WorkersKVQueues

qianshuixia2026: D1 free row-read cap burned twice in one day, plus R2 and Workers pitfalls after the first paid orders

浅水虾 (@qianshuixia2026) published a 16 November 2026 X article after the first $12 and $29 orders. On 14 November a 10-minute cron full-table scan burned the D1 Free 5 million daily row-read cap in 2 hours 14 minutes; the same evening the author ran wrangler d1 execute --remote statistics that scanned about 4.08 million rows in 5 minutes and hit the cap again, then paid $5 to upgrade to Workers Paid. The article also covers an R2 multipart complete() customMetadata mismatch that failed a >24 MB export five times (50 credits sent as apology), 128 MB / 10 ms / 50-subrequest walls that a paid plan does not lift, and Queues’ 10,000 daily operations with three operations per delivered message.

GuideDurable ObjectsD1Workers

Anti-abuse code that burned the Durable Objects allowance: heartbeats, rejected requests and D1 scans

Frank Zeng (@frankzeng2020) says an AI-written anti-abuse module pushed Durable Objects to 1.19 million requests against the 1 million included each month, costing him an extra $0.15; a budget alert email caught it, and the audit also found a D1 query path scanning 925 million rows a day and a signing key re-imported on every request. He shares a read-only self-audit prompt.

GuideD1

D1 on the free plan: unindexed queries burn rows read

风易 (@Michael_liyang) says the costliest thing on the free plan is not writes but queries without an index: D1 bills by rows read and an unindexed query scans the whole table, multiplying rows read (a figure he marks as still to be confirmed). He recommends indexing hot query fields, selecting only needed columns and logging slow queries.

GuideDurable ObjectsSQLite

Bradley Leatherwood: on Durable Objects every SQLite row read is billed; a quiet-moment ANALYZE produced 20,006 reads to return 5 rows, and a plain ANALYZE on a 37,000-row object was billed about 2 million rows

On 2026-11-02, Bradley Leatherwood published an inKibra note, also linked from the X account @mayliveforever, about SQLite inside Cloudflare Durable Objects. The platform bills every row SQLite reads, not just the rows it returns: a lookup that returns 5 rows but checks 20,000 is billed for 20,000. The author says that for several days the Cloudflare bill ran around $66 a day, almost all of it rows read, because queries were reading every row when no index was used; the peak day came to $366, mostly rows written. These amounts are the author’s reported invoices, not a Billflare case total in this guide. The same event is already recorded as a Billflare case; this entry is the technical post-mortem, including later figures the case snapshot may not yet carry.

GuideWorkersDurable ObjectsQueuesContainersCron Triggers

Lunora: codegen lints that name the billing meter a loop moves

Daniel (@_prisis_) says a Cloudflare bill spike is usually a loop, not traffic; his framework Lunora now flags count_without_index, queue_dispatch_cycle, cron_every_minute and container_long_sleep_after at codegen, before deploy, naming the meter each one moves.

GuideWorkersD1KVR2QueuesDurable ObjectsWorkers AIImages

WquGuru: a read-only Cloudflare billing audit prompt

WquGuru (@wquguru) shares a read-only audit prompt that checks account usage, D1 query plans, loops and retries, Durable Object wake-ups, high-priced operations and Worker config, then ranks risks by worst-month cost.

GuideD1Workers

A $500 D1 bill? Check rows written first

Layerbase walks through the D1 write meter using a public $513.20 invoice: writes cost 1,000× reads per row, indexes add written rows, and common causes include reprocessing jobs, upsert loops and writes on the read path.

GuideD1Workers

Watch D1’s daily row quotas while testing

Michal Raczka (@michalraczka) warns that D1’s daily row read and write quotas can stop all D1 queries until midnight UTC, notes that indexes trade reads for extra writes, and moves heavy tests to local Miniflare.

GuideD1

FlareCost: D1 Free daily row-write limit error at 100,000 rows

FlareCost's error page explains the D1 message shown when an account hits 100,000 rows written in a UTC day on Free: writes fail until 00:00 UTC, Workers Paid includes 50 million rows written a month then $1 per million, and indexes make the cap easier to hit because writing an indexed column also writes the index. Reviewed against official pages on 2026-11-02.

GuideD1

FlareCost: what a D1 full table scan costs past 25 billion rows read

FlareCost's scenario scans the same 5-million-row table 200 times a day for 30 days: 30 billion rows read, 5 billion of them billed at $0.001 per million, totalling $10.00 on Paid including the $5 minimum. It stresses that D1 bills rows scanned, not rows returned, and that indexes cut reads but add a written row when the indexed column changes. Rates as published on 2026-11-02.