At a glance
Slow Statements During Checkout Window (5m) lists the slow CockroachDB statements that fired in the same 5-minute window as a measured dip in storefront checkout completion. It is a focused, time-boxed join: not every slow query in the cluster, only the slow ones that overlap a checkout drop, so a DBA sees exactly which database statements correlate with shoppers failing to complete. This is the card that turns “checkout conversion fell” from a marketing mystery into a database work item. When five or more slow statements co-occur with a checkout drop, the cluster is very likely the cause, and the listed statements are your prime suspects.
Calculation
The card intersects two signals inside a rolling 5-minute window:crdb_internal.cluster_statement_statistics, the same data DB Console SQL Activity ranks), filtered to statements that exceeded the configured slow-latency threshold during the window. The checkout signal comes from the linked storefront connector’s completion or conversion rate, compared against its recent baseline for the same window.
The card only populates when both conditions hold in the same window: checkout dipped and more than five slow statements fired. That intersection is deliberate. Slow statements happen all the time and are mostly harmless; a checkout dip can have many causes that have nothing to do with the database. The value of this card is the overlap, the moments where slow database work and failing checkouts coincide, because that is when the cluster is the prime suspect. Each row shows the statement fingerprint, how many times it ran, its p95 latency in the window, rows read, and when it was last seen, so the on-call DBA can move straight from “checkout is dropping” to “this statement is why”.
Worked example
A platform team runs CockroachDB behind the cart, inventory, and order services for a retailer on Adobe Commerce. The slow-statement threshold is 200ms. Marketing flags that checkout completion fell during a Saturday promotion. Snapshot taken on 18 Apr 26 at 11:40 BST, covering the 11:35 to 11:40 window where checkout completion dropped from a baseline of about 71% to 58%.
Six slow statements co-occur with the checkout dip, above the five-statement threshold, so the card raises the alert and links the conversion drop to the database. Reading the rows, the pattern is clear: the two inventory statements (
SELECT ... FOR UPDATE and the decrement UPDATE) are the slowest at over 1 second p95 and the most damaging, because they sit directly on the checkout path. The promotions scan reading 42,000 rows is the smell of a missing index on active, made worse by the promotion driving everyone to the same hot rows.
What the on-call DBA does with this:
- Identify the path-critical offenders. The two inventory statements are on the checkout critical path and are slowest; they are the first to fix. The
FOR UPDATEand decrement contending on the same hot SKUs during a promotion is a classic contention hotspot. Cross-read Top Contended Statements and Transaction Retries (24h) to confirm contention. - Spot the quick win. The
promotionsfull scan reading 42,000 rows for anactive = truefilter is an obvious missing-index fix that will help every checkout, not just the hot SKUs. - Size the revenue impact and decide. A 13-point drop in completion during a promotion is real lost orders. If the inventory contention cannot be relieved immediately (index, retry tuning, splitting the hot range), the short-term call may be to throttle the promotion’s traffic so checkouts that do start can complete.
- Co-occurrence is the whole point. Slow statements alone are routine; a checkout dip alone is ambiguous. This card only speaks when the two overlap, which is precisely when the database is the suspect worth chasing.
- Read the rows for the critical path first. Not every slow statement on the list is causing the drop. The ones on the checkout path (inventory locks, order inserts, cart updates) are the suspects; a slow analytics query that merely happened in the same window is noise.
- Rows-read is a fast diagnosis. A statement reading tens of thousands of rows to return one result is a missing-index tell. It is often the cheapest fix on the list and helps every transaction, not just the hot ones.
Sibling cards
Reconciling against the source
Where to look natively:
DB Console SQL Activity → Statements, sorted by latency, for the slow statement fingerprints and their execution counts in the window.
SELECT * FROM crdb_internal.cluster_statement_statistics ORDER BY statistics->'statistics'->'svcLat'->>'mean' DESC; to inspect slow statements by service latency.
DB Console SQL dashboard (latency panels) to confirm the cluster-wide p95 / p99 spike during the same window.
The checkout side has no CockroachDB equivalent: confirm the conversion / checkout-completion dip in your Shopify / BigCommerce / Adobe Commerce analytics for the same 5 minutes.
Why our number may legitimately differ from the native view:
Cross-connector reconciliation: