Build1 distinct publisher3 min readUpdated
A dev.to write-up argues Multi-Source Inventory leaves an unbounded reservation table in the read path of every cart operation. The reported cost: 200-800ms per product, per add-to-cart.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
A write-up published on dev.to by MageVanta describes a Magento 2 failure mode that presents as a hosting problem and is actually a retention problem: with Multi-Source Inventory enabled by default since Magento 2.4, the `inventory_reservation` table grows without bound while every cart operation reads it [1] [2]. The consequence for operators is that checkout latency degrades on stores whose traffic has not changed, so scaling the database buys time rather than a fix.
The mechanics are ordinary. MSI does not decrement stock when a customer adds to cart; `placeReservation` writes a negative reservation row, order placement links it to the order, and shipment decrements `inventory_source_item` and is supposed to write a compensating positive row that cancels the negative one [3]. In theory the rows are transient [4]. In practice, according to the author, cancelled orders leave orphaned negatives, checkouts that fail mid-flight leave reservations that are never compensated, partial shipments produce partial compensation, errored quote conversions leave danglers, and reindexing, restocking and admin edits can duplicate records [5].
The author reports that after six to twelve months of moderate traffic the table routinely reaches several million rows, and says he has seen tables above 10 million rows on stores doing 200 orders a day [6] [7]. His example store, running eight months, had 4,872,341 rows, of which 4,710,882 were older than 30 days, or 96.7 percent [8] [9]. That leaves 161,459 rows inside the window a 30-day retention policy would keep [10], and implies an accumulation rate of roughly 20,000 rows a day [11].
The cost sits in the read path. Every `addToCart` and `placeOrder` executes a `SELECT SUM(quantity) ... WHERE sku IN (...) GROUP BY sku` [12]. The default schema has a primary key on `reservation_id` and no index useful for that pattern, so the query degrades to a full table scan [13]. The author puts that at 200-800ms per cart operation per product, and 2-4 seconds added to a five-item cart [14] [15] - a range that implies 400-800ms per line item rather than the low end of his own estimate [16]. Past the point where the table no longer fits the InnoDB buffer pool, he reports disk I/O, lock contention and lock timeouts surfacing as 502s or failed checkouts [17]. That is the tell: the symptom is a web-tier error, the cause is a table nobody empties.
Measurement first: `information_schema.tables` for size, and the `performance_schema` statement digest summary to confirm the query is actually hot [18]. On a typical affected store the author says the SUM query appears in the top five slowest digests with 300-600ms averages [19]. The proposed index is a composite on `(sku, created_at)`, which he reports takes a 600ms query under 20ms on a 5 million row table by using a covering index scan [20] - about a thirtyfold reduction [21] - applied with `pt-online-schema-change` or MySQL 8 instant DDL to avoid downtime [22]. The index is the cheap half. The other half is retention: rows older than the order lifecycle, typically 30-90 days, can be compensated and archived, and the author's cron example uses a 30-day retention constant and only processes SKUs whose orders are complete or cancelled [23].
Caveats worth noting. Every latency number here is one practitioner's field observation, not a published benchmark [14] [19] [20], and the cleanup class in the post is shown only partially, so the deletion logic is not verifiable from the article as published [24]. Watch your own digest table before accepting the ranges, and watch what your row count looks like after netting compensated pairs, because deleting a negative reservation that was never actually compensated moves salable quantity.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
Multi-Source Inventory (MSI) has been the default in Magento since version 2.4.
The inventory_reservation table grows without bound and every single cart operation hits it.
The reservation flow is: add to cart triggers placeReservation, which writes a negative reservation record; placing the order links the reservation to the order; shipping the order decrements inventory_source_item and the reservation should be compensated by a positive record that cancels the original negative one.
In theory reservations are transient, existing only to bridge the gap between cart and shipment; in practice they accumulate forever.
Every addToCart and placeOrder call executes the query pattern SELECT SUM(quantity) FROM inventory_reservation WHERE sku IN (...) GROUP BY sku.
The default schema has a primary key on reservation_id but no index useful for the query pattern Magento actually uses, so with millions of rows and no useful index on sku the query becomes a full table scan.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One practitioner post; mechanism checkable, numbers not
The cluster contains a single dev.to article. Its structural claims are strong and independently checkable by a reader (MSI default since 2.4, the reservation lifecycle, the SUM(quantity) query pattern, a primary key on reservation_id with no index serving that pattern), and it supplies runnable diagnostics so a reader can test the thesis locally. Every quantitative claim, by contrast, is a first-person recollection with no methodology, environment, sample definition, or second source, and two of the reported counts imply inconsistent accrual rates.
Anecdotal field reports from one author
Adoption evidence is limited to what one practitioner says he has seen. The affected surface is credibly broad because MSI is the platform default since Magento 2.4, but the cluster quantifies neither the affected install base nor uptake of the proposed remediation: the only deployment signals are unnamed stores with multi-million-row tables and a single before/after index timing. No named deployments, no third-party reports, no upstream acknowledgement.
Real mechanism, overstated magnitudes
The underlying failure mode is plausible and the fix is conventional, but the framing and figures run ahead of what is shown. 'Silent checkout killer', '10M+ rows', 200-800ms per line item, and a 30x index win are presented with false precision from one unreplicated environment; the five-item 2-4 second figure quietly uses the top half of the author's own range; the later 300-600ms band is never reconciled with the earlier 200-800ms; and the trailing-30-day count implies roughly a quarter of the daily accrual the eight-month average implies. Offsetting this, the post does hand readers the queries to falsify it themselves, so the gap is overstatement of magnitude rather than invention.
Practitioner expertise marketing on a self-publishing platform
The item is self-published on dev.to under a Magento-focused account handle (magevanta in the URL path), with no editorial review and no stated affiliation or interest disclosure. The content pattern - dramatic severity framing, precise but unverifiable numbers from unnamed client stores, and a custom module as the remedy - aligns with demonstrating agency-style Magento performance expertise. That is a moderate incentive to overstate severity, not evidence of bad faith: the technical guidance is standard and the diagnostics are honest enough to let readers check the premise.
Mechanism credible, magnitudes and safety unresolved
Confidence is moderate-low. The direction of the story - an unbounded, poorly indexed table in the synchronous cart read path degrading checkout - is coherent and testable, and the index and retention remedies are conventional. But the cluster is single-source, the numbers are unreplicated and partly self-contradictory, the deletion job's safety is asserted with a fragile LIKE join, and the capture is truncated before the article's later material can be assessed.
build
Slow Magento reindexes are a price index problem, and raw SQL makes it worse1 distinct publisher
build
TiDB quietly turns primary-key ORDER BY into a TopN, and the fix is not in v8.5.71 distinct publisher
build
Four indexes, none of them covering: the 78-second page and the one index that fixed it1 distinct publisher
build
Your Magento admin is slow because order state lives in fifteen tables, not because Varnish is off1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 15, 2026