dwhat

Free tool · BigQuery and Snowflake

Compare warehouse cost before and after a change

Did the change you shipped cut warehouse spend? What put the bill up? Export your query history once, pick a period before and a period after, and see each period's compute cost, the change in total and per day, and the users, dbt models and dashboards it came from — without an account, a credential, or the file leaving your computer.

Nothing is uploaded. The file is read by this page's own JavaScript and the comparison is drawn in the page; there is no request that sends it anywhere, which your browser's network tab will confirm. Close the tab and it is gone. dwhat counts visits to this page and nothing else.

What it compares, and what it does not

1. Export the query history

BigQuery: INFORMATION_SCHEMA.JOBS_BY_PROJECT
Export query
SELECT
  job_id,
  FORMAT_TIMESTAMP('%Y-%m-%dT%H:%M:%E3SZ', creation_time) AS creation_time,
  user_email,
  statement_type,
  SUBSTR(query, 1, 20000) AS query,
  TO_JSON_STRING(labels) AS labels,
  total_bytes_billed,
  total_bytes_processed,
  total_slot_ms,
  TIMESTAMP_DIFF(end_time, start_time, MILLISECOND) AS elapsed_ms,
  cache_hit,
  reservation_id
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
  AND job_type = 'QUERY' AND state = 'DONE'
  AND IFNULL(statement_type, '') != 'SCRIPT'
  AND (IFNULL(total_bytes_billed, 0) > 0 OR IFNULL(total_slot_ms, 0) > 0)
  1. Run it in the BigQuery console, in that project. It needs a role with bigquery.jobs.listAll, such as BigQuery Resource Viewer, and is billed like any other query.
  2. Under the results, choose Save results and then CSV (or Google Drive, for a large result).
  3. It reads the last 30 days. To reach further back, change INTERVAL 30 DAY; BigQuery keeps job history for 180 days.
Snowflake: QUERY_ATTRIBUTION_HISTORY with QUERY_HISTORY
Export query
SELECT
  a.query_id,
  TO_VARCHAR(a.start_time, 'YYYY-MM-DD"T"HH24:MI:SS.FF3TZH:TZM') AS start_time,
  a.user_name,
  a.warehouse_name,
  a.warehouse_id,
  q.query_type,
  LEFT(q.query_text, 20000) AS query_text,
  a.query_tag,
  q.bytes_scanned,
  a.credits_attributed_compute,
  q.total_elapsed_time,
  q.bytes_spilled_to_remote_storage,
  q.partitions_scanned,
  q.partitions_total
FROM snowflake.account_usage.query_attribution_history a
LEFT JOIN snowflake.account_usage.query_history q
  ON q.query_id = a.query_id
 AND q.start_time >= DATEADD(day, -31, CURRENT_TIMESTAMP())
WHERE a.start_time >= DATEADD(day, -30, CURRENT_TIMESTAMP())
  1. Run it in a Snowsight worksheet. It needs ACCOUNTADMIN or the SNOWFLAKE database rolesUSAGE_VIEWER and GOVERNANCE_VIEWER, and is billed to the warehouse it runs on.
  2. Download the results as CSV from the results pane.
  3. It reads the last 30 days. To reach further back, change both -30 and -31; ACCOUNT_USAGE keeps a year.

2. Choose the file

The synthetic example is a made-up BigQuery project over 16 UTC days, with a made-up change on2026-09-08: one dbt model starts a full refresh every night, a dashboard refreshes half as often, and a reservation takes over one nightly job.

Explain every change as it happens

This is one export, one time. Connected with a read-only account, dwhat reads the history every few hours, adds Snowflake's idle warehouse time from metering, emails you when a day costs much more than usual and names who and what caused it, and builds a monthly report for finance that compares each month with the one before.

Connect a read-only account for a free auditSee a sample audit first