At a glance
A row-level table of Databricks SQL queries that ran slow (above the warehouse latency threshold) during the active checkout window, correlated against a live drop in storefront orders. For a platform team, this answers one question: “is my data layer the reason checkout is stuttering right now?” Each row is one slow statement: the warehouse it ran on, the user or service principal that issued it, the elapsed time, and whether it overlapped a checkout conversion dip. When five or more slow queries co-occur with a measurable checkout drop in the same five-minute window, the card fires. This is the card you open at 14:00 on a flash-sale day when the orders graph wobbles and nobody knows why.
Calculation
The card is computed in three stages, all over the same trailing five-minute window.-
Pull slow statements. The engine queries
system.query.history(or the Query History API where the system table is not enabled) for the last five minutes, keeping rows wheretotal_duration_msis greater than the warehouse slow threshold. Each surviving row becomes a table entry: statement id, warehouse, executing identity,total_duration_ms,rows_produced, and thestart_timetoend_timespan. - Read the checkout signal. In parallel, the connected storefront connector reports orders per minute for the same window. Vortex IQ compares that figure to the same-weekday, same-hour baseline (a rolling four-week median). A “checkout drop” is recorded when current order rate falls a configurable percentage below baseline (default 20%).
-
Correlate and count. The two streams are joined on the shared UTC window. The headline count is the number of slow statements; the alert state is
slow_query_count > 5 AND checkout_drop = true. The detail (Slow SQL Queries During Checkout Window, broken down by row) drives the per-row table so an engineer can jump straight from “checkout dipped” to “these are the five statements that were blocking the warehouse when it dipped”.
Worked example
A UK homeware brand on Shopify runs its storefront personalisation and stock-availability lookups against a Databricks SQL serving warehouse (wh-serving-prod, a Small auto-scaling warehouse). A separate Large warehouse (wh-analytics) is used by the merchandising team for BI. Snapshot taken on 14 Apr 26 at 13:05 BST, ten minutes into a payday promotion.
The orders-per-minute graph, normally tracking around 38/min for a 13:00 weekday slot, has just fallen to 27/min. The platform engineer opens this card.
The Vortex IQ headline reads 6 slow queries during a checkout drop and the card is outlined in red because the count is above the threshold of five and a checkout drop is live. The engineer reads three things straight away:
-
Five of the six slow statements are storefront serving queries on
wh-serving-prod, all single-row lookups taking 8 to 11 seconds. A single-row lookup should return in tens of milliseconds. Eight seconds means the warehouse is queueing, not computing. The serving warehouse is saturated. Cross-check with SQL Warehouse Saturation %, which reads 96%. -
The sixth row is the smoking gun. A merchandising analyst kicked off a 14-second, 38,901-row scan on
wh-analytics, but the workspace had a shared cluster pool andwh-serving-prodhad been configured to burst into the same pool. The analytics query starved the serving warehouse of slots. This is a noisy-neighbour incident, not a code regression. - The checkout drop is real and it is costing money. Orders fell from 38/min to 27/min, an 11/min shortfall. At an average order value of £62, that is roughly £680 of orders per minute not landing while the warehouse is jammed.
wh-serving-prod from the shared analytics pool (or move the analyst’s workload to an isolated warehouse), and bump the serving warehouse to scale-out so it stops queueing. Within two minutes the serving lookups drop back under 100 ms, saturation falls to 41%, and orders/min recovers to 37. The post-incident action is a guardrail: serving and analytics warehouses must never share a pool during promotional windows.
Three takeaways for the platform team:
- Single-row lookups taking seconds is the tell. When the duration is high but
rows_producedis tiny, the warehouse is queueing, not crunching. That points at saturation or a noisy neighbour, not query SQL. - The cross-platform join is what makes this actionable. Five slow queries with healthy checkout is a yawn; five slow queries with a live order dip is a revenue incident. The card only pages on the combination.
- Isolate serving from analytics. The most common cause of this card firing is a heavy BI or pipeline query stealing slots from the storefront-serving warehouse. Pair with DBU by Cluster (7d) to confirm which workloads share compute.
Sibling cards merchants should reference together
Reconciling against the source
Where to look in Databricks:Query History (in the SQL workspace, Query History tab) for the per-statement list with duration, status, and the user who ran it. Filter by warehouse and time range to match the five-minute window.Why our number may legitimately differ from Databricks’s own UI:system.query.history(Unity Catalog system table) to run the same filter as SQL:SELECT statement_id, compute.warehouse_id, executed_by, total_duration_ms FROM system.query.history WHERE start_time >= now() - INTERVAL 5 MINUTES AND total_duration_ms > 5000 ORDER BY total_duration_ms DESC. SQL Warehouse monitoring (the warehouse’s Monitoring tab) for queued vs running query counts, which confirm whether slowness is queueing or execution.
Cross-connector reconciliation:
Known limitations / merchant FAQs
The card shows slow queries but checkout looks fine. Why is it not red? By design. The card lists slow statements at all times for visibility, but it only pages when slow queries co-occur with a measurable checkout drop. Slow queries during a healthy checkout window are logged so you can tune later, but they are not an incident. If you want to chase slow queries regardless of checkout state, use Slow-Query Rate % or Top 10 Slowest SQL Queries instead. Checkout dropped but this card shows zero slow queries. Where do I look? That is a useful negative result: it rules out the data layer. The cause is most likely storefront, CDN, or payment gateway. Check the storefront connector’s order and conversion cards, the payment connector status, and your CDN dashboard. Databricks is not the bottleneck this time. Does this card prove the slow queries caused the checkout drop? No, it proves co-occurrence in a tight five-minute window, which is the strongest correlation signal available without end-to-end tracing. The single-row-but-slow pattern (high duration, tinyrows_produced) is a strong indicator of warehouse queueing in the serving path, but always confirm with SQL Warehouse Saturation % before acting.
My slow queries are all on the analytics warehouse, not the serving one. Should I care?
Only if that warehouse shares a compute pool with the serving warehouse, which is the classic noisy-neighbour cause. If they are fully isolated, an analytics slowdown cannot affect checkout, and you can scope this card to serving warehouses only so analytics noise stops triggering false alarms. Set the warehouse scope in the connector settings.
Why does a single-row lookup take eight seconds?
Almost never the SQL. It is queueing: the warehouse has no free slots, so the statement waits before it runs. The execution itself is milliseconds. The fixes are to scale the warehouse out (more clusters), isolate it from competing workloads, or enable serverless so it scales faster under burst. Check the warehouse Monitoring tab for queued-query counts to confirm.
Does system.query.history capture every query?
It captures SQL warehouse query history once Unity Catalog system tables are enabled and the query schema is granted. Queries run on all-purpose or job compute (notebooks, jobs) are not in system.query.history; those surface through the Jobs and clusters APIs instead. If your storefront serving path runs on a cluster rather than a SQL warehouse, point the card at the relevant cluster source and expect a slightly different latency basis.
How current is the data given the system table lag?
The card re-evaluates every 60 seconds over a five-minute window. system.query.history can lag by up to a few minutes, so a query that finished seconds ago may not appear immediately. For genuinely real-time triage during a live incident, cross-check the Query History UI in the SQL workspace, which is closer to live, and treat this card as the correlated, persisted record.
Can I change the slow threshold or the checkout-drop percentage?
Yes. Both are configurable per profile in the Alert Rules tab: the slow threshold (default 5,000 ms, set per warehouse) and the checkout-drop percentage (default 20% below the rolling four-week weekday baseline). Tune the slow threshold to your warehouse class and the drop percentage to how noisy your order rate normally is, so the card pages on real incidents, not normal variance.
The merchandising team complains the card blames their BI queries. Is that fair?
It is fair when their warehouse shares a pool with the serving warehouse, because their large scans then steal slots from storefront lookups. The fix is isolation, not blame: give serving and analytics separate warehouses (or separate pools) so a heavy BI query can never degrade checkout. Once isolated, this card will stop attributing checkout dips to their workload.