96 copy-paste SQL queries that audit a Databricks account's cost, performance, compute, jobs, serving, storage and governance — built entirely on system.* tables. No app to install, no dashboard to wire up: open a query, read what it does and how to read the result, copy the SQL, and run it.
Start hereThe first audit — a guided runbookRun the ten highest-signal queries in order — trust check, then the money, then the risk — and walk away with a filled findings sheet in about 90 minutes. No system-tables background needed.Everything here is open source — grab all 96 queries from the GitHub repository ↗. Clone the repo and every .sql file is ready to paste; each query below also links straight to its own source.
Find where the bill actually goes, prove the negotiated discount is landing, charge back by team, and hunt recoverable waste.
Right-size compute, move jobs off expensive all-purpose clusters, and shut down idle warehouses and dormant serving endpoints.
Tune the heaviest queries with real pruning / spill / shuffle signals, harden pipeline reliability, and keep table maintenance efficient.
Audit grants, masks and row filters, trace how far PII propagates, and catch run-as escalation and network exfiltration attempts.
Seven domains. Pick one to browse its queries — almost every one is a copy-paste SELECT that takes a :period_days bind parameter.
New to the account? These ten are the highest-signal queries to run first — the biggest money and the biggest risk.
SELECT on the system.* schema the query reads — some schemas must be enabled by an account admin first.:period_days parameter, and run.TABLE_OR_VIEW_NOT_FOUND / insufficient_privileges on your account — that's expected, not a bug. Every dollar figure is est · at list (pre-discount, DBU-only) unless a query joins account_prices, and usage_quantity is DBUs / bytes / hours / tokens — never dollars. Sample-output tables are illustrative synthetic rows, never real account data.SELECT except storage_breakdown_analyze, which runs ANALYZE TABLE … COMPUTE STORAGE METRICS — it writes table statistics (flagged in red on its page). Run it only against tables you are allowed to analyze.system.billing.list_prices) unless a query explicitly joins account_prices.usage_quantity is DBUs / bytes / hours / tokens — never dollars.