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.
| What it tracks | A row-per-statement table of slow statements (latency above the slow threshold) observed during a 5-minute window in which storefront checkout completion dropped, joined so only checkout-overlapping slow statements are shown. |
| Data source | CockroachDB side: slow statements from crdb_internal.cluster_statement_statistics (and DB Console SQL Activity), filtered by the slow-statement latency threshold, the same population feeding Slow-Query Rate %. Checkout side: checkout-completion / conversion rate from the linked Shopify / BigCommerce / Adobe Commerce connector. |
| Metric basis | A correlated count plus a statement list, not an average. The signal is co-occurrence: slow statements and a checkout dip in the same 5-minute window. |
| Time window | 5m: a tight window aligned to checkout behaviour, so the slow statements shown are the ones temporally adjacent to the conversion drop rather than the cluster’s all-day slow log. |
| Alert trigger | >5 slow co-occur with checkout drop: more than five slow statements observed in the same 5-minute window as a measured checkout-completion drop. |
| What counts as a row | A statement whose execution latency exceeded the slow threshold and whose execution time falls inside a 5-minute window where checkout completion dipped below its baseline. |
| What does NOT fire | (1) Slow statements when checkout is healthy (surfaced on Slow-Query Rate %, not here); (2) A checkout dip with no slow statements (the cause is elsewhere: payments, front-end, marketing); (3) Five or fewer slow statements during a dip (below the co-occurrence threshold). |
| Roles | DBA, platform, SRE |
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%.| Statement (fingerprint) | Exec count | p95 latency | Rows read | Last seen |
|---|---|---|---|---|
SELECT ... FROM inventory WHERE sku = $1 FOR UPDATE | 940 | 1,180ms | 1 | 11:39:58 |
UPDATE cart_items SET qty = $1 WHERE cart_id = $2 | 610 | 870ms | 1 | 11:39:55 |
SELECT ... FROM promotions WHERE active = true | 540 | 640ms | 42,000 | 11:39:51 |
INSERT INTO orders (...) | 120 | 410ms | 1 | 11:39:47 |
SELECT ... FROM customers WHERE id = $1 | 880 | 220ms | 1 | 11:39:59 |
UPDATE inventory SET qty = qty - $1 WHERE sku = $2 | 760 | 1,050ms | 1 | 11:39:60 |
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
| Card | Why pair it with Slow Statements During Checkout Window | What the combination tells you |
|---|---|---|
| Slow-Query Rate % | The cluster-wide slow-statement rate this card time-boxes to checkout. | A high slow rate that overlaps checkout is what populates this card; a high rate with healthy checkout is lower priority. |
| Statement Latency p95 (ms) | The overall latency trend behind the slow statements. | p95 spiking in the same window confirms the slowness is cluster-wide, not a single statement. |
| Statement Latency p99 (ms) | The tail that checkout abandonment is most sensitive to. | A p99 blowout during the window explains abandonment even when p95 looks acceptable. |
| Top Contended Statements | Identifies hot-row contention behind slow checkout writes. | Inventory FOR UPDATE slowness plus contention events equals a hot-SKU lock problem. |
| Transaction Retries (24h) | Contention on the checkout path forces retries. | High retries during the window mean the slow statements are retrying, compounding latency. |
| Statement Error Rate % | Slow statements can tip into failed ones. | Errors rising with the slow statements means some checkouts are failing outright, not just lagging. |
| CRDB Statements Spike vs Ecom Order Rate | The query-volume cross-channel sibling. | A statements spike plus slow checkout statements means excess load is dragging the checkout path. |
| CRDB Pool Saturation vs Traffic Burst | A saturated pool makes everything, including checkout, slow. | Slow checkout statements during a saturation breach point at connection starvation, not query plans. |
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:
| Reason | Direction | Why |
|---|---|---|
| Window scoping | Vortex IQ shows fewer | DB Console SQL Activity shows all slow statements over its retention window; this card shows only those inside the 5-minute checkout-dip window. The shorter, overlap-only list is intentionally narrower. |
| Statistics flush cadence | Brief lag | CockroachDB flushes statement statistics on an interval; a statement that just ran may appear in the card a flush behind DB Console’s live view, or vice versa. |
| Threshold definition | Either way | The slow threshold is configurable in Vortex IQ; if it differs from the latency cut you apply when sorting DB Console, the row counts will not match exactly. |
| Fingerprint grouping | Vortex IQ may group | Statements are grouped by fingerprint; literal-by-literal views in native tooling can show more distinct rows for what is one fingerprint here. |
| Card | Expected relationship | What causes divergence |
|---|---|---|
| CRDB Statements Spike vs Ecom Order Rate | Slow checkout statements often coincide with a statements spike. | Slow statements with no spike means a few heavy statements, not volume, are the cause. |
| CRDB Pool Saturation vs Traffic Burst | A saturation breach can make checkout statements slow. | Slow checkout statements with no saturation breach point at query plans or contention, not connection starvation. |