SQL queries · Content tag
Browse content discussing sql queries.
57 matching items
Cases · 17
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
maylivesforever: after moving from GCP to save money, a single day’s Cloudflare bill exceeded the whole monthly GCP bill.
maylivesforever says services were moved from GCP to Cloudflare to save money, and then a single day’s Cloudflare bill came in bigger than the whole monthly GCP bill. The author explains that Durable Objects bill every row SQLite reads, not every row it returns, and that one of their queries read 20,006 rows to return 5. A follow-up reply links the author’s write-up on how to avoid the mistake. No amount is given.
Reported amount · USD
Not disclosed
edwardindiedev: a billing alert revealed an AI-written query scanning the whole table; the screenshot shows $98.49 of D1 Rows Read.
edwardindiedev says a Cloudflare billing alert arrived unexpectedly; the author first suspected a traffic spike on a recently launched site, but found that an AI-written query in their own backlink platform scanned the full table every time the platform was opened to check backlink-pool usage. The attached cost breakdown shows D1 Rows Read of 123.49B total, 98.49B billable, costing $98.49, with daily cost rising sharply around October 31–November 1, 2026 (UTC).
Reported amount · USD
$98.49
prince (@prince_twets): a D1 full-scan bug led to an unexpected ~$200 bill for a pre-launch SaaS; asks for a one-time credit.
prince (@prince_twets) says the pre-launch JobClaw SaaS, which has no customers or revenue, received an unexpected bill of about $200 after a D1 full-scan bug. The author says their own report attributes about $182 of it to D1 read overage, that the query paths were removed and production was shut down, and that they cannot afford it. The author asks whether Cloudflare Billing could review a one-time credit, offers to share details privately, and tags Cloudflare accounts and staff in a follow-up reply.
Reported amount · USD
$200
Kun Save Point (@Savepoint_kk): a D1 bug rewrote unchanged data into a $2,739.12 bill; $2,141 goodwill credit granted.
Kun Save Point (@Savepoint_kk), an indie developer who says he recently lost his job, says a bug repeatedly rewrote unchanged data while inefficient queries amplified reads, producing a $2,739.12 Cloudflare bill already paid via PayPal (D1 rows written $2,641.00, rows read $64.06, other services $34.06); he says his bills were usually under $10 a month. Cloudflare granted a $2,141 goodwill account credit under case #02391058. He asks for it to be converted into a refund to the original PayPal payment, or at least for relief on the $2,641 write charges, and later writes that the initial request was declined and has been reopened for additional review. On October 25 he adds that he missed the only alert email Cloudflare sent, whose amount was not particularly high, and received no further warning before the large card charge; on October 26 he writes that the refund request to the original payment method is still under further review. On November 10 he posts a timeline saying that after following up on November 10–11, support again stated the $2,141 could only remain as account credit and the remaining $598.12 was still undecided while the ticket was being closed. On 26 November 2026 the author posted another public thread asking what a "final decision" means. He says that in the first case an agent called a refund impossible as a "final decision," then submitted it for further review; that after several business days he was told the account credits could not be refunded while the remaining amount was still under review; and that the first case was later closed without a clear resolution of that remaining amount. He opened a second case; an agent said the remaining amount had been definitively rejected, another "final decision." After the author posted on X, a senior billing specialist (Agent D) confirmed that the previously rejected amount had actually been refunded. The author asked whether the larger $2,141 account credit could be converted into a cash refund; after being told it was under review, an agent from the first case declared another "final decision": no refund. The author asks who reviews these requests and why a supposedly final rejection was later followed by an actual refund, and says D1 on Workers Paid still lacks a configurable hard spending cap. The posts cite cases #02391058 and #02447083. There is no staff reply on that public thread.
Reported amount · USD
$2,739.12
Jay (@Cyberlane): a $513.20 D1 bill for two small personal databases; Cloudflare confirms a refund.
Jay (@Cyberlane) says two small D1 databases used only by himself for two little apps produced a bill of over $500 for reads and writes. He later quotes the invoice: 452,256,462 rows written ($453) and 60,197,421,138 rows read ($60.20) for Sep 17 – Oct 16, a D1 total of $513.20 before tax. Tyson Trautmann, whose profile lists Storage & Databases at Cloudflare, replies publicly and loops in the D1 engineering team.
Reported amount · USD
$513.20
wickedev: a D1 ranking-update loop and about $10,846 across two billing periods.
wickedev reports about $10,846 from a repeated D1 ranking update: a paid $6,209 September bill plus $4,637 estimated for the October billing period. He later says a $5,704 refund was approved and is still being processed.
Reported amount · USD
$10,846
Yan Zhu (picturepan2): about $400 from a D1 row-reads spike.
Yan Zhu (@picturepan2) says he also hit an about $400 Cloudflare bill the previous month when D1 database row reads spiked. He quotes the shmily7 Durable Objects thread for context and does not report a refund or support outcome.
Reported amount · USD
$400
Sven Guettner: a D1 bug produced a $1,868 bill from about 1.89 trillion row reads.
Sven Guettner says a wrong database setting on offercompass.app made every small update read the whole table in the background between Aug 28 and Sep 22, 2026, totaling about 1.89 trillion rows and a $1,868 D1 bill. He fixed the bug, shut the project down, opened ticket 02338870 asking for a courtesy credit, and reports only AI replies so far.
Reported amount · USD
$1,868
zmuleyu (yourchars.com): a $1,481.11 invoice from 1.476 trillion D1 rows read, with a $976.11 account credit.
Community user zmuleyu (yourchars.com) says an unintended query pattern repeatedly ran high-volume D1 scans during the July 17–August 16 billing period, reading about 1.476 trillion rows and producing a US$1,481.11 invoice (US$1,476.11 for D1 plus US$5 for Workers Paid). The author restricted public access, fixed the query path and added controls and alerts. Cloudflare granted a US$976.11 account credit on August 19, leaving US$500 of the D1 charge uncredited. The author asks how the credit was calculated, why US$500 was left, and how the balance can be used; support said the amount came from a case-specific review by a Finance team, the balance applies automatically to future eligible invoices, and closed the case again. The author notes budget alerts on Workers Paid are informational, not a hard limit.
Reported amount · USD
$1,481.11
Rentier Digital: D1 billed a zero-user dev app like production traffic.
Phil (rentierdigital) reports a filing-monitor app still in development—zero users—reading about 47 million D1 rows in a day (averaging about 12.9 million against a 5 million free-tier daily cap, with a July 2 spike to 22 million). He traces the cost to a background poller scanning 18,000 rows per tick and returning empty 447 of 451 times, then migrates off D1. He does not state a dollar invoice amount.
Reported amount · USD
Not disclosed
Kent C. Dodds: full-table D1 aggregates produce a $195.05 rows-read line item.
Kent C. Dodds links a pull request on X calling it "an unfortunate lesson". The pull request says the Aug 8, 2026 Cloudflare invoice ($213.79 total) included a $195.05 D1 line item for 195 billion rows read (Jul 8–Aug 7), mostly attributed to two full-table PostRead aggregates cached only in per-isolate memory. The change moves those results to a shared KV-backed cache.
Reported amount · USD
$195.05
MXGA: a reported $209.37 bill after a D1 query bug.
@luoleiorg describes a D1 query bug that raised usage roughly 1,400-fold. An initial $200-plus report becomes $209.37 in a later post; the author says Cloudflare waived the previous month’s entire invoice after a support request.
Reported amount · USD
$209.37
Mircea Trofimciuc: agent count(*) queries on D1 and a reported $700+ bill.
Mircea Trofimciuc (@MirceaTrofim) reports a $700+ bill after an AI agent ran a few count(*) queries on a large D1 table to get the number of records. He says support won't credit the account and that he was charged, and asks @CloudflareDev for help.
Reported amount · USD
$700
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
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
D1 import failures reset the database and inflated writes to about 550 million rows.
ken7 reports migrating a read-heavy site to Workers with D1, then repeated internal D1 failures that reset the instance and forced full re-imports. The author says about 550,456,381 rows written on the invoice reflect failed import retries rather than production usage, and requests a waiver or credit. No dollar amount is given.
Reported amount · USD
Not disclosed
Guides · 39
yaobuilds: Auto-refresh on the stats page may use up the D1 free tier's daily quota of 5 million rows read
On 2026-11-19, X user @yaobuilds reminds: a D1 free account has a daily quota of 5 million rows read, counted by rows scanned. The author gives an example: assuming 10,000 rows are scanned per minute, 24 hours requires reading 14,400,000 rows. The suggestion is to look at meta.rows_read first, then multiply by the number of calls per day; when the total does not need to be updated in real time, it can be cached for a few minutes. The author writes that the busiest "user" may be one's own auto-refresh. This is a usage calculation method, not a bill that has already occurred.
hontrandev: a Workers Free D1 board list query read about 15,000 rows to return 58
On 2026-11-18, X user @hontrandev wrote that Cloudflare emailed that D1 had reached 78% of the 5 million rows-read-per-day limit on Workers Free, for a small internal ticketing app. The author says one board list query was reading about 15,000 rows to return 58, and that they wrote up why and how they fixed it, with a link in a reply. This is a usage warning on the Free daily cap, not an invoice amount.
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.
风易: On the free tier, do not brute-force concurrent D1 writes; queue first, then write serially
On 2026-11-17, X user @Michael_liyang (风易) wrote a new D1 write experience note: on the free tier, do not brute-force concurrent D1 writes; queue first, then write serially. The author says D1 writes are serial; when several requests write the same table at the same time and collide, the mild case is a retry and the severe case is a failure. The approach is: 1. Write requests enter the queue first; 2. The consumer writes serially, batch by batch; 3. On failure, return to the queue and wait for the next round. The chain is request → enter the queue → write D1 serially → return to the queue on failure. The author emphasizes that reads can be freely concurrent, and writes must be queued.
风易: On the free tier, do not send write operations one by one; a D1 batch can write N rows at one time
On 2026-11-17, X user @Michael_liyang (风易) wrote: on the free tier, do not send write operations one by one; what one batch write saves is the number of rows written and the number of subrequests. D1's batch can carry multiple statements at one time, and one call writes N rows. The chain is request → accumulate a batch → write once with batch → retry the whole batch on failure, and use an idempotency key as a backstop. The author's judgment: do not accumulate when real-time requirements are high; accumulate only for logs, bookkeeping, and bulk imports; write how long to accumulate into the config, and force a flush to disk on timeout.
风易: On the free tier, do not wait synchronously for bookkeeping and log writes; return first, then persist to the database in the background with waitUntil
On 2026-11-16, X user @Michael_liyang (风易) wrote: on the free tier, do not wait synchronously for bookkeeping and log writes; return the response first, and throw write operations to the background. A synchronous write to D1 both slows the response and burns CPU time. The approach is: the response contains only the business result; bookkeeping goes through waitUntil to persist in the background; on failure, enter the queue for a catch-up write. The chain is request → call upstream → return the result first → write the books in the background → catch-up write on failure.
风易: What cache fears most is looking up things that do not exist; a crawler scanning random keys makes every request hit D1
On 2026-11-16, X user @Michael_liyang (风易) wrote: what cache fears most is looking up things that do not exist. A crawler scans random keys, penetrates every time, and hits D1 directly, so the cache is added for nothing. The approach is to cache empty results as well, and give the TTL only 5 minutes; log high-frequency nonexistent keys to D1, and blacklist them once confirmed to be a crawler. The chain is request → check cache → return on hit → query D1 on miss → write an empty-value cache if it does not exist. The author's judgment: the cache prevents repeated lookups; it does not block lookups of nonexistent things on the database's behalf.
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.
风易: On the free tier, do not log in full; logging in full burns the D1 rows-written count first
On 2026-11-14, X user @Michael_liyang (风易) wrote: on the free tier, do not log in full; what full logging burns first is the D1 rows-written count. The approach is: log all errors, with a trace id and an error code; sample only 1% of successes, enough to see the trend; write the sample rate into the config, temporarily raise it when investigating, then lower it back. The chain is request → assign a level → log all errors / sample successes → redact → persist to D1. The author's judgment: logs are for investigation, not for stockpiling for retirement; the rows written that are saved are left for real errors.
Community: D1 Free daily row-read block with about 12,000 rows showing after the UTC reset
On 14 November 2026, kaushalkrishna011 reported that production D1 reads on flexiyo.kaushalkrishnax.workers.dev were blocked with “Account has exceeded the daily D1 Free tier limit of 5,000,000 rows read,” while usage after the 00:00 UTC reset was only about 12,000 rows. A 24-hour dashboard view showed about 11 million rows, including usage before the reset. The account had one D1 database; Explore Data was also blocked. There was no staff reply as of this run.
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.
FlareCost: D1 OFFSET still burns rows-read on Free; prefer keyset pagination
@FlareCost replies that D1 Free meters rows read (scanned), not rows returned, so OFFSET still burns the 5M/day Free cap (reset 00:00 UTC), and that keyset pagination on an index avoids that. The parent post notes D1 now fails any query result over 50 MB.
Nash: 115,937 D1 call-log rows since 22 October, after logging every uptime-monitor 402; sampling 1 in 100 cut the noise
On 2026-11-04, X user @NashBriggsy (Nash) wrote that their D1 call log had 115,937 rows since 22 October. Every request to their agent tools wrote one row with 17 columns (tool, status, paid, price, payer, ms, country, user agent and more). The flow was: the agent asks, gets a 402 with the price, signs, the facilitator settles, the tool answers, and the Worker writes the row. What went wrong, the author says, is that they also logged every uptime monitor’s 402, and that ran up the D1 bill. On 29 October they started sampling monitor 402s at 1 in 100 and added a time index for reports. The post does not state a dollar amount.
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.
D1 rows read and Queues operations: two free allowances that run out with few users
Su (@Sukiea1008) explains why D1’s rows-read allowance and Queues’ operation count are easy to misjudge: a query returning 10 rows may scan 10,000, and one queue message usually costs three operations plus retries. She adds notes on indexes, KV’s one-write-per-second per key and Hyperdrive’s query count.
Running a job board on Workers Free: error 1102, D1’s 50 queries per request, and shared egress IPs
SagaSu (@sujingshen) describes keeping DMtheFounder on the Workers Free plan: SSR CPU of P50 54 ms against a 10 ms limit caused error 1102 until he edge-cached anonymous pages, an admin job hit D1’s 50-queries-per-invocation limit until he batched writes, and IndexNow 429s came from shared Workers egress IPs.
Self-hosted analytics on D1: rows scanned, not rows returned, decide the bill
Lynn (@hizachlynn) estimates how a D1-backed analytics tool without pre-aggregated rollup tables scales: dashboard queries scan raw events, so at 1 million pageviews a month one load scans about 428 million rows; all figures are the author’s estimates.
D1’s 100,000 daily row writes: how naive upserts took a sanctions app offline
A DEV Community post by Oleksandr (alexcodebytes) describes a Workers + D1 compliance app whose ingestion hit D1’s free daily write limit (error 7500) because every upsert counted as a write, and the fixes: a WHERE clause on DO UPDATE, per-run page caps, and staging raw files in R2.
Three billing traps an AI left in an e-commerce backend, and a worst-case bill audit prompt
Frank Zeng (@frankzeng2020) says his AI-built e-commerce backend ran a month at $0, but a Claude audit of its Cloudflare billing found three amplification paths; he fixed them in half a day and shares a read-only audit prompt that ranks worst-case costs.
How far the Cloudflare free tier goes: a walkthrough of its limits from domain to AI
铜匠 (@CopperForgeAI) walks through launching a personal site on Cloudflare and checks each free allowance against the docs, separating the domain plan, the Workers plan and Zero Trust, and warns that free limits stop service while paid overages are charged.
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.
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.
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.
A polling table scan can read billions of D1 rows with no users
Jad (@JadMadi), replying to a $500 D1 bill thread, says D1 bills per row read rather than per query, so an unindexed scan on a polling interval can read billions of rows; he advises checking indexes and query plans.
D1 scheduled updates: count runs, not empty queues
wickedev explains how a once-daily full-table update ran hundreds of times a day, and shares the checks he would add after an unexpected D1 bill.
Writing a Cloudflare cost-guard skill for coding agents
An AIIDE List guide on turning Cloudflare billing safety into an agent skill with BUILD, AUDIT, PREDEPLOY and INCIDENT modes, plus risk rules for D1 queries, Durable Object alarms, polling, Queues and R2.
After a $10,000 loop bill: budget alerts and a cost-audit prompt for vibe-coded projects
铁柱AGI (@cgnot996) writes an X article that walks through creating a Cloudflare budget alert, explains why it is only a notice, lists cost-amplifying code patterns, and gives a read-only audit prompt and steps for when a bill has already spiked.
D1 free tier hard limits: budgeting a small app’s database after the September 2026 enforcement
涂阿燃 reads Cloudflare’s September 2026 D1 free tier enforcement notice and turns it into a budget for small apps: how rows are metered, which query patterns burn the daily quota, how to find them, and how to degrade gracefully when the quota runs out.
A small project read 33 billion D1 rows: where the reads came from and a pre-release checklist
Sylwair reviews how a small content site on Workers Paid used more D1 rows read than the monthly allowance, explains how D1 counts scanned rows, names the four query patterns that multiplied reads, and lists the fixes and a checklist to run before shipping.
D1 Query Budget: reject queries that read too many rows
An open-source TypeScript experiment that measures D1 rows read, checks that results are correct, and rejects a candidate query that exceeds a declared row-read budget, with a CLI that verifies the report.
D1 pricing and free daily row limits
Cloudflare explains D1 read/write billing, free daily limits, and usage tracking.
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.
FlareCost: D1 on the Free plan, daily row caps and 500 MB per database
FlareCost's D1 Free page lists 5 million rows read and 100,000 rows written per day with 5 GB total storage, queries failing at the next row past a daily cap until midnight UTC, and per-database limits (ten databases of 500 MB each, 7 days of Time Travel, 50 queries per invocation). Reviewed against official pricing pages on 2026-11-02.
FlareCost: Cloudflare D1 queries per Worker invocation
FlareCost’s d1-queries-per-invocation page (reviewed 2026-11-02) is checked against the official Cloudflare pricing pages listed under Sources. Free plan: 50 queries per invocation. Paid plan: 1,000 queries per invocation. A `db.batch()` counts as one query against this limit, even if it contains many statements. Issuing 2,000 individual queries fails with `Too many API requests by single Worker invocation`. The batch still reads and writes the rows inside it. The invocation limit is not a billing discount.
FlareCost: Cloudflare D1 query duration
FlareCost’s d1-query-duration page (reviewed 2026-11-02) is checked against the official Cloudflare pricing pages listed under Sources. Free plan: 30 seconds, because the HTTP API itself must finish in 30 seconds. Paid plan: 30 seconds. A single statement that updates hundreds of thousands of rows can exceed execution limits. The docs say to batch work, for example 1,000 rows at a time. Time spent inside D1 still sits inside the Worker CPU and memory limits.
FlareCost: D1 row width is not a second meter — rows read are rows scanned
FlareCost's D1 row and statement limits page lists 2 MB per row, 100 columns, 100 KB per statement and 100 bound parameters, and says a row's width does not change the row-read price: a 1 KB row and a 100 KB row are both one row, and rows read are rows scanned. Reviewed against official pages on 2026-11-02.
FlareCost: Cloudflare D1 rows-read allowance
FlareCost’s d1-rows-read-allowance page (reviewed 2026-11-02) is checked against the official Cloudflare pricing pages listed under Sources. Free plan: 5 million rows read per day, reset at 00:00 UTC. Queries fail after that. Paid plan: First 25 billion rows a month included, then $0.001 per million. A full scan counts every row. The official example is `SELECT * FROM table` on 5,000 rows counting as 5,000 reads. Paid reads are prorated. One billion rows past the allowance cost $1.
Cutting a D1 bill 95% with composite indexes, ANALYZE and a KV cache
Justin Ahinon walks through finding the four queries behind 127.6 billion D1 rows read and fixing them with indexes, ANALYZE and cache-aside KV for layout-level data.
Estimating a SaaS bill on Cloudflare Workers by billing unit, not by MAU
李辰 of 小李出海笔记 argues that a Cloudflare SaaS bill cannot be read off monthly active users and walks through Workers, D1, R2, Workers AI and Vectorize by their own billing units, with an estimation template and a checklist.
Skills · 1
Cloudflare billing risk audit skill
Ask your coding agent to check a Cloudflare project for loops, retries and repeated work that could drive up costs, with code locations and suggested improvements.
daftai-cloudflare-billing-audit