← Workflows

阅读中文版本

Warehouse Cost Optimization Workflow

Attribute warehouse spend to queries and workloads, eliminate the expensive low-value tail, and set per-team budgets with visible dashboards.

intermediate~30 mindata-pipelinecostoptimization

Objective

Reduce warehouse spend by attributing cost to workloads, cutting waste with evidence, and assigning budgets that make consumption visible to its owners.

Environment

  • A cloud warehouse with query history and cost attribution (Snowflake, BigQuery, or similar)
  • Per-team workspace or project separation
  • Access to billing or usage-export data

Steps

1. Attribute cost to queries

Join query history with resource consumption to rank the most expensive queries, jobs, and dashboards by spend over the last 30 days.

Expected state: A cost leaderboard exists naming the top consumers, including who owns them.

2. Classify the expensive tail

For each top consumer, classify it as legitimate (business-critical), wasteful (full scans without filters, SELECT star), or forgotten (dashboards nobody opens).

Expected state: Every expensive item has a class and a next action.

3. Cut the waste with evidence

Fix or remove the wasteful class: add partition filters, cache repeated dashboard queries, retire unused reports with usage stats shown to their owners.

Expected state: The wasteful spend drops measurably in the following billing period.

4. Set team budgets with visibility

Assign per-team credit budgets with a dashboard of consumption versus budget, plus alerts at 80 percent and 100 percent.

Expected state: Teams see their own burn daily, before the invoice surprises them.

5. Review monthly against unit economics

Hold a monthly review of cost versus value: dollars per analysis run, cost trend versus usage trend, and next waste targets.

Expected state: The review produces the next optimization batch with owners and expected savings.

Expected outcome

Warehouse spend attributed and visible per team, with the wasteful tail retired and a monthly cycle that keeps cost proportional to analytical value.

Verification

The next invoice reflects predicted savings from removed items; team dashboards show consumption within budget; the monthly review output lists actions with owners.

Nobody optimizes an invoice they cannot attribute

Warehouse cost is invisible until it is assigned: the same cluster serves critical models and forgotten dashboards alike. Attribution first, waste-cutting second, budgets third — in that order, because cutting before attributing removes the wrong things.

-- cost leaderboard (30d)
SELECT query_tag, warehouse, credits,
       round(credits * 2.30, 2) AS usd,
       owner_tag
FROM query_history_agg
ORDER BY credits DESC LIMIT 10;

-- findings:
--  dashboard_v7  (0 opens in 60d)     $1,842  retire
--  daily_rollup  (no partition filter) $1,204  +filter -> $88
--  ml_feature_etl (business critical)  $2,910  keep

-- team budgets (monthly credits)
--  analytics: 400   ml: 900   eng: 150  (alert 80%/100%)

The forgotten dashboard is the easiest win

Every warehouse has reports whose consumers left the company years ago. Usage stats make retirement a five-minute conversation instead of a guess: nobody opens it, it costs this much, it goes. Attribution turns that from anecdote into an email with a number.

Budgets change behavior where invoices do not

A central invoice is everyone’s problem and therefore no one’s. Per-team credits with a live dashboard and threshold alerts convert consumption into a local, visible quantity — and most waste disappears before the month ends without any central mandate.