Clarify scope and timeline first: confirm the dashboard’s date range, timezone, and source table(s). Ask if any deployments, manual refund runs, or finance reports occurred that day.Step 1 — Quick sanity checks- Compare totals day-over-day and hourly to see if spike is brief or sustained.sql
SELECT date_trunc('hour', refunded_at) AS hour, count(*) AS refunds
FROM refunds
WHERE refunded_at >= '2025-11-01'::date - interval '2 days'
GROUP BY 1 ORDER BY 1;
- Check refund rate vs orders:sql
SELECT refunded_date, COUNT(*) AS refunds, orders, ROUND(100.0*COUNT(*)/orders,2) AS refund_pct
FROM (
SELECT DATE(refunded_at) AS refunded_date, 1 AS refund
FROM refunds
WHERE refunded_at BETWEEN '2025-11-01' AND '2025-11-01' + interval '1 day'
) r
JOIN (
SELECT DATE(created_at) AS created_date, COUNT(*) AS orders
FROM orders
GROUP BY 1
) o ON r.refunded_date = o.created_date
GROUP BY refunded_date, orders;
Step 2 — Instrumentation / data quality checks- Check duplicate or backfilled records, unusually large batch ids or missing user_ids:sql
SELECT refund_batch_id, COUNT(*) AS cnt, SUM(amount) AS total_amount
FROM refunds
WHERE refunded_at::date = '2025-11-01'
GROUP BY refund_batch_id ORDER BY cnt DESC;
SELECT COUNT(*) FROM refunds WHERE refunded_at::date = '2025-11-01' AND user_id IS NULL;
- Check source ETL/job runs & ingestion timestamps in metadata tables.Step 3 — Business context checks (is it manual batch?)- Look for refunds with same processor id, same reason_code, same operator:sql
SELECT reason_code, operator_id, COUNT(*) AS cnt
FROM refunds
WHERE refunded_at::date = '2025-11-01'
GROUP BY 1,2 ORDER BY cnt DESC;
- Check refund amounts distribution:sql
SELECT amount, COUNT(*) FROM refunds WHERE refunded_at::date = '2025-11-01' GROUP BY 1 ORDER BY 2 DESC LIMIT 20;
- If many identical amounts or same operator/batch_id => manual or scripted batch.Step 4 — Product/real issue checks- Correlate refunds with product SKUs, fulfillment centers, payment methods, or a specific promotion:sql
SELECT p.sku, COUNT(*) AS cnt
FROM refunds r JOIN orders o ON r.order_id=o.id JOIN products p ON o.product_id=p.id
WHERE r.refunded_at::date='2025-11-01' GROUP BY p.sku ORDER BY cnt DESC LIMIT 20;
- Check support tickets and chargeback rates same day.Step 5 — Cross-source validation- Reconcile refund counts against Finance/Payments ledger and gateway logs.- Compare OLTP vs analytics table counts; check late-arriving data.Stakeholders to contact (and why)- Finance/payments ops: reconcile amounts, batch refunds, payment processor logs.- Customer Support/CS Ops: spikes in tickets, scripted refunds, policy changes.- Engineering/ETL or Data Platform: recent deployments, ETL failures, schema changes, backfills.- Product/Operations: any promotions, recalls, or fulfillment incidents.Conclusion: If duplicates, batch_id/operator consistency, and finance ledger match → manual batch. If ingestion timestamps, ETL errors, or sudden backfill → instrumentation. If concentrated by SKU/region/promotion and matched by CS tickets → real product issue. Provide next steps and recommended fixes per outcome.