Query running

Arguments

database
"billing_replica"
max_rows
5
query
SQL below
SELECT account, plan,
       count(*)    AS failed,
       sum(amount) AS at_risk
FROM charges
WHERE status = 'failed'
  AND created_at > now() - interval '7 days'
GROUP BY account, plan
ORDER BY failed DESC, at_risk DESC
LIMIT 5;

Result

Waiting for rows
AccountPlanFailedAt risk
Billing Ops agent · step 2 of 4