Skip to main content
Metrics type: Key MetricsCategory: Cross-Platform: Revenue at Risk

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:
The slow-statement population is drawn from CockroachDB’s statement statistics (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:
  1. 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 UPDATE and 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.
  2. Spot the quick win. The promotions full scan reading 42,000 rows for an active = true filter is an obvious missing-index fix that will help every checkout, not just the hot SKUs.
  3. 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.
Three takeaways for the team:
  1. 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.
  2. 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.
  3. 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:

Known limitations / FAQs

My cluster has plenty of slow statements but this card is empty. Why? The card only populates when slow statements overlap a measured checkout dip. If checkout completion is healthy, slow statements are surfaced on Slow-Query Rate % instead, not here. An empty card during a healthy checkout window is the correct, good-news reading: the database is not currently dragging conversion. Checkout dropped but this card shows nothing. Does that clear the database? It strongly suggests the database is not the cause for that window. A checkout dip with five or fewer slow statements points the investigation elsewhere: payment-gateway latency, a front-end or JavaScript error, a marketing or pricing change, or a third-party widget. Use this card to rule the database in or out, then pivot to the front-end and payment signals if it stays empty. Why a threshold of more than five statements rather than any slow statement? A single slow statement coinciding with a checkout dip is usually coincidence; slow statements are common and checkout dips have many causes. Requiring more than five co-occurring slow statements raises the confidence that the database is genuinely implicated before the card raises an alert. If you run a very low-traffic cluster where even a few slow statements matter, lower the threshold in the Alert Rules settings. All six statements are listed, but which one is actually causing the drop? The card shows correlation, not proof. Prioritise by two things: whether the statement sits on the checkout critical path (inventory locks, cart updates, order inserts beat a stray analytics query), and the rows-read figure (a statement reading tens of thousands of rows for one result is a missing-index smell). The path-critical, high-rows-read statements are your prime suspects; confirm with Top Contended Statements. The statement list differs from DB Console SQL Activity. Why? This card scopes to the 5-minute checkout-dip window and shows only overlap, so it is deliberately a shorter list than DB Console’s full retention view. Statement-statistics flush cadence can also put the two a flush apart, and a different slow-latency threshold will change the counts. Align the window and threshold before treating a difference as a discrepancy. Could connection-pool saturation make checkout statements look slow here? Yes, and that is an important distinction. If Connection Pool Saturation % is breaching during the window, the statements may be slow because workers are queuing for sessions, not because the statements themselves are inefficient. In that case the fix is relieving saturation (pooler, more capacity), not rewriting queries. If saturation is healthy, focus on the statements and their indexes. How tight is the 5-minute window to the checkout dip? The window is aligned to the measured dip, so the slow statements shown are temporally adjacent to it rather than drawn from the cluster’s all-day slow log. Statistics flush cadence means a statement can land a flush before or after its true execution moment, so treat the window as tight but not millisecond-exact. The shape of the overlap across the window is what to trust, not a single row’s timestamp.

Tracked live in Vortex IQ Nerve Centre

Slow Statements During Checkout Window (5m) is one of hundreds of KPI pulses Vortex IQ tracks across CockroachDB and 70+ other ecommerce connectors. Nerve Centre runs the detection layer; Vortex Mind investigates the cause when something moves; Ask Viq lets you interrogate any number in plain English. Start for free or book a demo to see this metric running on your own data.