New to an account and staring at 96 queries? Run these ten, in this order, and you will have a real findings sheet in about an hour and a half — no system-tables background required.
Audit in three moves. Trust the numbers before you use them, chase the money while the account is fresh in your head, then check the risk that does not show up on a bill. Each step below tells you what a healthy account looks like, the one column to read, a synthetic example of a bad result, and the one decision to write down.
~5 min · cost_restatement_trust_metric
retracted_abs_quantity and restatement_usage_quantity are a small fraction of net_usage_quantity, and max_ingestion_date is yesterday or today.restatement_usage_quantity ÷ net_usage_quantity
RETRACTION and RESTATEMENT rows, not by editing history — so if a large slice of the period was later restated, or the feed is stale, every dollar figure you compute below is still moving.| cloud | net_usage_quantity | restatement_usage_quantity | max_ingestion_date |
|---|---|---|---|
| AWS | 999,500.00 | 180,000.00 | 2026-06-18 |
| AZURE | 500,000.00 | 0.00 | 2026-07-05 |
max_ingestion_date is current, proceed and quote net_usage_quantity to finance. If it is large or stale, mark the whole audit's dollar figures provisional and re-run when the feed catches up.Per-SKU net DBUs alongside their default-rate dollars and list-rate dollars, so an admin can quantify how much the account's discount actually saves on each SKU — both rate bases come from list_prices (no account_prices/negotiated-rate table exists in this environment).
net_default_cost is a little below net_list_cost by a consistent margin, and no SKU shows large DBUs against a NULL cost.net_list_cost − net_default_cost
| cloud | sku_name | net_usage_quantity | net_default_cost | net_list_cost |
|---|---|---|---|---|
| aws | ENTERPRISE_ALL_PURPOSE_COMPUTE | 12,500 | 5,500.00 | 6,875.00 |
| azure | PREMIUM_JOBS_SERVERLESS_COMPUTE | 800 | NULL | NULL |
Net DBU consumption and distinct run count per job per day, split by workspace, cloud, product line, and classic-vs-serverless placement.
job_id dominating the day; the classic-vs-serverless split matches what you expect to be scheduled.net_usage_quantity
job_id to target instead of the whole account.| usage_date | workspace_id | job_id | is_serverless | net_usage_quantity | distinct_runs |
|---|---|---|---|---|---|
| 2026-07-04 | 9876543210987654 | 771044 | false | 1,180.00 | 1 |
| 2026-07-04 | 1234567890123456 | 849302 | false | 412.75 | 24 |
job_id to name + owner via system.lakeflow.jobs, and flag heavy-run and high-run-count offenders for right-sizing.Net DBU consumption and record count broken down by every custom_tags key/value pair per usage_date, cloud, workspace, and product line — with untagged usage retained as NULL-key rows so the "% untagged" denominator is real.
tag_keys, each resolving to multiple distinct tag_values (real teams / cost centers), and the NULL-key (untagged) slice is small.distinct tag_value per tag_key + the NULL-key slice
| billing_origin_product | tag_key | tag_value | net_usage_quantity | record_count |
|---|---|---|---|---|
| JOBS | cost_center | shared-platform | 9,850.00 | 412 |
| DLT | NULL | NULL | 1,560.20 | 88 |
cost_center covers almost everything but resolves to a single value — the “100% tagged” mirage. Meanwhile a whole DLT slice carries no tag at all.cost_totals_by_sku_day) and any umbrella tag; require a per-team / cost-center dimension before chargeback means anything.Net DBU (and other-unit) consumption multiplied by the point-in-time list rate to produce a pre-discount list-dollar figure (net_list_cost) per usage_date x cloud x SKU x product x usage_type x unit x currency.
net_list_cost in a consistent currency_code; the daily total tracks your expected run-rate.net_list_cost
| usage_date | cloud | sku_name | usage_unit | net_usage_quantity | net_list_cost |
|---|---|---|---|---|---|
| 2026-07-01 | AWS | ENTERPRISE_SQL_COMPUTE | DBU | 4,200.00 | 2,940.00 |
| 2026-07-01 | AZURE | ENTERPRISE_JOBS_SERVERLESS_COMPUTE | DBU | 800.00 | NULL |
Net DBU consumption per usage_date x cloud x SKU x product line, split out by the serverless, Photon, jobs/SQL/DLT tier, and serverless performance-target choices so each premium lever can be sized.
is_serverless/is_photon true, fast performance targets) are a deliberate minority, and each premium row has a cheaper baseline sibling in the same product family.net_usage_quantity on is_serverless / is_photon = true rows
| cloud | sku_name | is_serverless | is_photon | net_usage_quantity |
|---|---|---|---|---|
| aws | ENTERPRISE_SQL_COMPUTE_SERVERLESS_(PHOTON) | true | true | 1,842.75 |
| aws | ENTERPRISE_SQL_PRO_COMPUTE | false | false | 612.40 |
The top 1000 finished, non-cached SQL statements in the trailing window, ranked by execution time (a DBU-cost proxy), each carrying pruning, spill, shuffle, and scan counters plus a de-valued query text to diagnose the fix.
pruned_files ≫ read_files), zero spilled_local_bytes, and modest shuffle_read_bytes.execution_duration_ms
| statement_id | statement_type | execution_duration_ms | read_files | pruned_files | spilled_local_bytes | shuffle_read_bytes |
|---|---|---|---|---|---|---|
| 01ef…4a5b | SELECT | 742,000 | 18,400 | 210 | 0 | 5,368,709,120 |
| 01ef…7081 | MERGE | 518,000 | 9,600 | 95 | 4,294,967,296 | 1,073,741,824 |
statement_ids with their signal — poor pruning → partition/cluster; spill → size up or rewrite; big shuffle → fix the join. This is your tuning worklist.Per SQL warehouse, the total seconds spent RUNNING (the auto-stop idle tail), STARTING (cold-start tax) and STOPPED, the worst single RUNNING gap, and event counts by state — all derived from state-transition events over the trailing :period_days window.
stopped_seconds dominates (the warehouse is off when idle); running_seconds is low and max_running_gap_seconds sits near the configured auto_stop_minutes × 60.max_running_gap_seconds
| warehouse_id | running_seconds | stopped_seconds | max_running_gap_seconds | net_dbus | est_usd_list |
|---|---|---|---|---|---|
| a1b2…5c6d | 5,400 | 78,000 | 1,800 | 980 | 490.00 |
| 7c6b…9e8f | 900 | 5,400 | 300 | 260 | 130.00 |
auto_stop_minutes in sql_warehouse_config_current, and lower it so they suspend sooner.One row per job that had at least one failed run in the trailing window, with its distinct/failed run counts, the latest failure's termination code, total job DBUs, and a wasted-DBU proxy (job DBUs scaled by failed-run share).
failed_runs is a small share of distinct_runs and wasted_dbus_proxy is low.wasted_dbus_proxy (and its est_usd_list)
| workspace_id | job_id | failed_runs | distinct_runs | last_failed_termination_code | wasted_dbus_proxy | est_usd_list |
|---|---|---|---|---|---|---|
| 1234567890123456 | 775511 | 10 | 10 | STORAGE_ACCESS_ERROR | 1,500 | 750.00 |
| 1234567890123456 | 884422 | 25 | 100 | CLUSTER_ERROR | 200 | 400.00 |
last_failed_termination_code; the code drives the fix (quota → raise limits; CLUSTER/STORAGE errors → fix config).Per-job, per-cluster task-run counts over the trailing 30 days, tagged with the cluster's source so you can spot job tasks running on all-purpose (UI/API) compute instead of cheaper job clusters.
cluster_source is UI or API.cluster_source = UI / API with high task_runs
| workspace_id | job_id | compute_id | cluster_source | task_runs | net_dbus | est_usd_list |
|---|---|---|---|---|---|---|
| 1234567890123456 | 884422 | 0715-091234-ab12cd34 | UI | 612 | 14,200 | 7,100.00 |
| 1234567890123456 | 775533 | 0715-090011-jobclu99 | JOB | 1,440 | 30,500 | 15,250.00 |
UI/API job cluster ranked by task_runs; migrate the highest-frequency offenders to job clusters or serverless — a recurring saving. Triage NULL cluster_source separately.A 30-day rollup of audited actions where the initiating principal (run_by) differs from the identity the action executed as (run_as), aggregated per service, action, and masked identity pair with event counts and first/last timestamps.
run_by → run_as pair is an explainable job or service-principal execution; nothing runs as a human owner unexpectedly.run_by ≠ run_as pairs (event_count, last_event_time)
| service_name | action_name | run_by | run_as | event_count | last_event_time |
|---|---|---|---|---|---|
| accountsAccessControl | updatePermissions | op**** | __REDACTED__ | 1 | 2026-07-05 11:47:02 |
| jobs | runNow | da****@**** | sv****@**** | 42 | 2026-07-05 02:15:11 |
run_by is authorized to act as the run_as, starting with the highest event_count / most recent. Zero rows → verify the audit table is actually populated before concluding “clean”.One row per step. Fill status, est · at list impact and owner as you go; the finding and a suggested next query are pre-filled. Copy it into a spreadsheet and you have the deliverable.
| Finding | Status | Est · at list impact | Owner | Next query |
|---|---|---|---|---|
| Discount Realization by SKU (actual vs list) | — | — | — | cost_dollarized_by_sku_day |
| Per-Job DBU Cost Ranking | — | — | — | lakeflow_jobs_on_all_purpose |
| Chargeback Coverage by Tag | — | — | — | cost_totals_by_sku_day |
| Dollarizing DBUs at List Price | — | — | — | cost_actual_vs_list_by_sku |
| Serverless, Photon & Tier Premiums | — | — | — | cost_dollarized_by_sku_day |
| Your Heaviest Statements, Ranked | — | — | — | query_pruning_effectiveness |
| Warehouse Idle-Tail Seconds | — | — | — | sql_warehouse_config_current |
| Failing Jobs Ranked by Wasted DBUs | — | — | — | lakeflow_retries_repairs |
| Job Tasks On All-Purpose Compute | — | — | — | cost_by_job |
| Run-As Privilege Escalation Watch | — | — | — | access_admin_role_change_events |
Something look off? The war stories show three of these findings played out end to end, and the reference & glossary explains every term and the est · at list label.