What you will be able to do
- Describe what system.billing.usage, system.billing.list_prices, system.compute.clusters, system.access.audit and the system.lakeflow tables record
- Join billing usage to job runs on workspace_id, job_id and job_run_id to attribute cost to the run that produced it
- Convert DBUs into list-price cost with system.billing.list_prices
- Attribute all-purpose cluster spend to an owner and pick the configuration fix for idle compute
- Build audit queries that combine action, identity and time filters
Key concept
System tables as a joinable operational store — System tables are read-only Delta tables in the system catalog. Databricks fills them with your account's billing, compute, job, pipeline and audit records. They share IDs such as workspace_id, cluster_id, job_id and run_id, so you answer a cost or audit question by joining a fact table like billing.usage to the dimension or timeline table that explains it.
1.What system tables are and who can query them
When finance asks why the bill doubled, or security asks who touched a table at 2 a.m., the answer is a SQL query against the system catalog. Databricks hosts the data there and fills it for you. Each schema covers one area: system.billing for usage and prices, system.compute for cluster configuration and node activity, system.access for audit events, and system.lakeflow for jobs and pipelines. You don't run anything to load these tables. They are free, and you pay only for the compute that runs your queries against them.
Access works like any other Unity Catalog object. A user who is both account admin and metastore admin can read the tables by default. Anyone else needs USE CATALOG on system plus USE SCHEMA and SELECT on the schemas they query. Your workspace must be enabled for Unity Catalog to query them, but the data still includes non-Unity Catalog workspaces in the account. You can't write to the tables, and that rules out one kind of fix: you can't hide an expensive cluster by deleting its rows. The only way to change future rows is to change the resource they describe.
| Area | Table path | Free retention | Regional or global |
|---|---|---|---|
| Billing | system.billing.usage | 365 days | Global |
| Billing | system.billing.list_prices | Indefinite | Global |
| Compute | system.compute.clusters, system.compute.node_timeline | 365 days / 90 days | Regional |
| Access | system.access.audit | 365 days | Regional for workspace-level events, global for account-level events |
| Lakeflow | system.lakeflow.jobs, job_tasks, job_run_timeline, job_task_run_timeline, pipelines, pipeline_update_timeline | 365 days | Regional |
The regional column affects what you see. A regional table only shows workspaces deployed in the same cloud region as the workspace you query from. If you need job history from a workspace in another region, you have to query from a workspace in that region. Billing is global, so you can see the whole account's spend from any region.
Checkpoint 1 of 9· Check yourself
An account has two Unity Catalog-enabled workspaces, one in us-east-1 and one in eu-west-1. A data engineer has the needed grants and runs queries from the us-east-1 workspace against system.billing.usage and system.lakeflow.job_run_timeline. What do the results include?
system.billing.usage is global, so it shows spend for the whole account from any region. The lakeflow tables are regional, so they only show workspaces in the same cloud region as the workspace you query from.
“To see records from another region, you must view the tables from a workspace deployed in that region.”Source: docs.databricks.com
2.Reading system.billing.usage
Usage is measured in Databricks units (DBUs), the unit that system.billing.list_prices monetizes at a rate per SKU, so a row's quantity is a count of DBUs and not a dollar amount. Each row in system.billing.usage is one metered slice of consumption. usage_quantity gives the amount, usage_unit gives the unit (usually DBU), and sku_name says what kind of compute was billed, for example STANDARD_ALL_PURPOSE_COMPUTE. The row also carries workspace_id, usage_start_time/usage_end_time and a usage_date meant for fast daily aggregation. It also has billing_origin_product (such as JOBS) and the resource's custom_tags, which let you charge spend back by team or environment. Records usually arrive within 12 hours. record_type stays ORIGINAL unless Databricks later issues a correction as a retraction or restatement.
The usage_metadata struct tells you which resource generated a row. It holds string IDs, but only the ones that apply to that compute type are filled in. The rest are null. The gaps follow fixed rules, and a cost report that ignores them will quietly lose spend.
| Key | Filled for |
|---|---|
| cluster_id | Non-serverless compute: notebooks, jobs, Lakeflow pipelines, legacy model serving |
| job_id, job_run_id | Serverless jobs and jobs on job compute; not jobs on all-purpose compute |
| job_name | Serverless jobs and jobs on job compute (job compute since September 2025) |
| warehouse_id | Workloads run on a SQL warehouse |
| dlt_pipeline_id, dlt_update_id | Lakeflow pipelines and features built on them, such as materialized views and Lakeflow Connect |
| notebook_id, notebook_path | Serverless notebooks |
To scope cost to a single pipeline, filter on the matching metadata key and group by SKU and day:
SELECT
sku_name,
usage_date,
SUM(usage_quantity) AS `DBUs`
FROM
system.billing.usage
WHERE
usage_metadata.dlt_pipeline_id = :dlt_pipeline_id
AND usage_start_time >= :usage_start_time
AND usage_end_time < :usage_end_time
GROUP BY
ALLThe identity_metadata struct records who the usage ran as. What run_as means depends on the workload. For jobs it is the job's configured run-as principal, which defaults to the owner. For Lakeflow pipelines it is the principal whose permissions run the pipeline. For all-purpose compute it is the identity that created the cluster, which isn't necessarily the current owner.
Checkpoint 2 of 9· Match them up
A FinOps analyst wants to tag each workload's spend in system.billing.usage. Match each workload to the usage_metadata key that identifies it on its billing rows.
Tap a term, then the definition that fits it.
usage_metadata fills only the IDs that apply to the compute type and leaves the rest null. cluster_id is for non-serverless compute, job_run_id is for serverless jobs and job compute, warehouse_id is for SQL warehouses, dlt_pipeline_id is for Lakeflow pipelines and features built on them such as materialized views, and notebook_path is for serverless notebooks.
“Only a subset of these values is populated in any given usage record, depending on the compute type and features used.”Source: docs.databricks.com
3.Turning DBUs into money with system.billing.list_prices
Usage rows count DBUs, not currency. The price is in system.billing.list_prices, a historical log with one row per price period for each sku_name, cloud and usage_unit. Each row has price_start_time, price_end_time, a currency_code such as USD, and a pricing struct. In that struct, pricing.default always returns a single list price that you can use for simple long-term estimates.
To get cost, join each usage row to the price row with the same sku_name, cloud and usage_unit whose window contains the usage. The usage start time should be on or after price_start_time and before price_end_time, or price_end_time should be null if that price is still current. Then multiply usage_quantity by pricing.default. Matching on the time window matters because a price change adds a new row rather than overwriting the old one. Last year's usage should be priced at last year's rate.
Checkpoint 3 of 9· Check yourself
To price last year's DBUs, an analyst joins system.billing.usage to system.billing.list_prices on sku_name, cloud and usage_unit. The analyst keeps only price rows where price_end_time IS NULL and multiplies usage_quantity by pricing.default. What is wrong with the resulting cost?
A price change adds a new row to list_prices and does not overwrite the old one. Keeping only the open-ended row prices all usage at the current rate. To price each usage row at the rate in effect at the time, match its start time to the price row whose price_start_time/price_end_time window contains it.
“A historical log of SKU pricing. A record gets added each time there is a change to a SKU price.”Source: docs.databricks.com
Sources4
4.Attributing classic compute spend with system.compute.clusters
system.compute.clusters is a slowly changing dimension. Databricks adds a new row each time a cluster's configuration changes, so the table holds the full configuration history of all-purpose, job and pipeline compute. Each row has the cluster_name, the owned_by user, the driver_node_type and worker_node_type, and either a fixed worker_count or min_autoscale_workers/max_autoscale_workers. It also records auto_termination_minutes, the dbr_version and cluster_source. cluster_source is UI or API for all-purpose compute, JOB for all job compute, and PIPELINE or PIPELINE_MAINTENANCE for pipelines.
On all-purpose compute, identity_metadata.run_as only tells you who created the cluster. To charge spend to the current owner, join usage to clusters on usage_metadata.cluster_id and take owned_by from the configuration version that was in effect when the usage happened:
SELECT
u.record_id record_id,
c.cluster_id cluster_id,
max_by(c.owned_by, c.change_time) owned_by,
max(c.change_time) change_time,
any_value(u.usage_start_time) usage_start_time,
any_value(u.usage_quantity) usage_quantity
FROM
system.billing.usage u
JOIN system.compute.clusters c
WHERE
u.usage_metadata.cluster_id is not null
and u.usage_start_time >= '2025-01-01'
and u.usage_metadata.cluster_id = c.cluster_id
and c.change_time <= u.usage_start_time
GROUP BY 1, 2
ORDER BY cluster_id, usage_start_time desc;This join is also where a cost spike turns into a fix. Suppose an all-purpose cluster with auto_termination_minutes set to 0 runs all week, and its owned_by is a service principal that no team claims. The DBUs come from idle time and nobody is responsible for them. The fix is in the cluster's own configuration. Set an auto-termination window so idle time stops costing DBUs, and change the owner through the Clusters API so future usage is charged to the team that runs it. Raising min_autoscale_workers would do the opposite, because it raises the floor of workers the cluster keeps. Each configuration change you make appears as a new row in clusters.
Node roles only need care when the driver and workers use different instance types. In that case usage comes as two records, one per instance type. If both use the same type, the usage is combined into a single record. To split usage by node role, cross-reference driver_node_type/worker_node_type in clusters, or the driver boolean in system.compute.node_timeline. node_timeline holds per-minute utilisation for each node.
Checkpoint 4 of 9· Check yourself
Alice created an all-purpose cluster. Last month, ownership was moved to the data team's service principal through the Clusters API. A chargeback report groups this month's all-purpose spend in system.billing.usage by identity_metadata.run_as. Who does the report charge for this cluster's usage?
On all-purpose compute, run_as is the identity that created the cluster, so the report keeps charging Alice after the transfer. To charge the current owner, join usage to system.compute.clusters on usage_metadata.cluster_id and take owned_by from the configuration row that was in effect at the time of use.
“This is not necessarily the compute owner. To attribute usage to the owner, join to system.compute.clusters.owned_by using usage_metadata.cluster_id.”Source: docs.databricks.com
Checkpoint 5 of 9· Exam question
Monthly compute spend has spiked. An engineer joins system.compute.clusters to system.billing.usage and finds several all-purpose clusters with autotermination_minutes = 0 running continuously under a shared owned_by service principal that no longer maps to an active team. What is the most effective first remediation based on this system table data?
Correct answer: A — Set an autotermination window on the clusters and update owned_by to the team that uses them, so idle time stops accruing and future usage attributes correctly.
- A. Enforcing autotermination directly removes the root cause of idle spend, and correcting
owned_byrestores accountability so the team responsible can monitor and control the cluster's cost going forward. - B. System tables are read-only records generated by the platform from actual account activity; deleting rows from them is not a supported operation and would not stop the underlying cluster from continuing to accrue real charges.
- C. Raising
min_workersforces the autoscaler to keep more workers running at all times, which increases baseline cost rather than reducing it, and does nothing to address a cluster that never terminates. - D.
system.billing.list_pricesis a reference table of historical SKU rates published by Databricks; it cannot be written to in order to negotiate a lower price, and utilization data has no mechanism to trigger a repricing through this table.
5.Job and pipeline cost with the system.lakeflow tables
The system.lakeflow schema records job and pipeline activity. It used to be called workflow, and both names hold identical content. It contains two kinds of table, and you query them differently. jobs, job_tasks and pipelines are SCD2 dimensions: any change adds a new row, and a deletion adds a row with delete_time set rather than removing anything. job_run_timeline, job_task_run_timeline and pipeline_update_timeline are immutable facts that record when each run, task run or update started and ended. They never need deduplication.
-- Get the current state of every job, excluding deleted jobs
with latest AS (
SELECT
*,
ROW_NUMBER() OVER(PARTITION BY workspace_id, job_id ORDER BY change_time DESC) as rn
FROM
system.lakeflow.jobs QUALIFY rn=1
)
SELECT * FROM latest WHERE delete_time IS NULLThe filter order is easy to get wrong. If you filter delete_time IS NULL while reading the table, a deleted job's earlier rows still match the filter. The query then returns the job's last state before deletion instead of leaving the job out. The partition key changes with the table: workspace_id, job_id for jobs, workspace_id, job_id, task_key for job_tasks, and workspace_id, pipeline_id for pipelines.
workspace_id appears in every one of those keys because a job_id is only unique within a single workspace. Two workspaces can both have a job 42. This is why cost-to-run attribution needs three equalities, not one. A usage row belongs to a run in job_run_timeline when u.workspace_id = rt.workspace_id, u.usage_metadata.job_id = rt.job_id and u.usage_metadata.job_run_id = rt.run_id. Shortcut joins fail. A cluster ID matched against a job ID compares different kinds of value. A SKU name says what kind of compute was billed, not which job used it. A run_as principal can run many jobs.
Runs longer than an hour are split across several hourly rows in the timeline tables, using period_start_time and period_end_time. result_state is filled only on the row that covers the end of the run. To count failures, take each run's final row instead of every slice. Pipelines follow the same pattern: usage_metadata.dlt_pipeline_id and dlt_update_id link billing to pipelines and pipeline_update_timeline. Event-level detail about a pipeline's flows and expectations comes from its pipeline event log.
Checkpoint 6 of 9· Fill the gap
This query should return the current state of every job and leave out jobs that have been deleted. Which source belongs in the blank so that deleted jobs are actually left out?
-- Get the current state of every job, excluding deleted jobs
with latest AS (
SELECT
*,
ROW_NUMBER() OVER(PARTITION BY workspace_id, job_id ORDER BY change_time DESC) as rn
FROM
system.lakeflow.jobs QUALIFY rn=1
)
SELECT * FROM ? WHERE delete_time IS NULLThe delete_time filter has to run on the deduplicated CTE, after the newest row per workspace_id and job_id has been picked. If you filter the raw SCD2 table (under either schema name), a deleted job's older rows still match. The query then returns the job's last state before deletion instead of leaving the job out.
Source: docs.databricks.comCheckpoint 7 of 9· Exam question
A FinOps engineer must attribute each dollar of Databricks Jobs compute to the specific job run that generated it, joining system.billing.usage with system.lakeflow.job_run_timeline. The engineer starts from this skeleton:
SELECT u.usage_quantity, u.sku_name, rt.job_id, rt.run_id
FROM system.billing.usage u
JOIN system.lakeflow.job_run_timeline rt
ON <JOIN_CONDITION>
Which <JOIN_CONDITION> correctly attributes each usage record to the job run that produced it?
Correct answer: A — u.workspace_id = rt.workspace_id AND u.usage_metadata.job_id = rt.job_id AND u.usage_metadata.job_run_id = rt.run_id, aligning billing records to the run's own workspace and identifiers.
- A. This condition matches on workspace, then narrows using the job and run identifiers that
usage_metadatacarries for Jobs compute, so usage rows are tied to the exact run that generated them rather than any run of the same job. This mirrors Databricks' documented pattern for attributing billing usage to Lakeflow job runs. - B.
usage_metadata.cluster_ididentifies the compute resource, not the job that scheduled it, so equating it to a job identifier produces a join that almost never matches and silently drops most usage rows from the report. - C.
sku_nameis a pricing category string like a warehouse or all-purpose compute tier, not a job identifier; comparing it tojob_idcannot uniquely identify a run and would incorrectly fan out usage across every job sharing that SKU. - D.
identity_metadata.run_asrecords who or what triggered the workload, which is useful for auditing but is not a job or run identifier, so this join fails to isolate usage for a specific job run and can match unrelated runs triggered by the same principal.
Sources2
6.Auditing activity with system.access.audit
system.access.audit has one row per logged event. Six columns do most of the work in an investigation. service_name names the service that emitted the event, such as unityCatalog. action_name names the operation, such as getTable. user_identity holds the caller's email or principal name. request_params is a map of the request's arguments, such as full_name_arg for the object touched. response is a struct with the status code and any error. event_time/event_date say when it happened. audit_level separates workspace-level from account-level events, and account-level events record workspace_id as 0.
Suppose a service principal is suspected of exporting data out of hours. A useful query narrows on what happened, who did it and when, and keeps all three filters. Filter action_name to the operation under investigation and user_identity to that principal. Use event_date to bound the date range, because it is the column that speeds queries up, and use the hour of event_time to keep only events outside working hours. A single filter on its own doesn't answer the question.
| Filter alone | What it actually returns |
|---|---|
| A success status in the response struct | Every successful event of any kind. Success describes the outcome, not the type of action |
| service_name of the compute service | Cluster lifecycle events, not the data operation itself |
| request_params full_name_arg only | Every access to that object by every identity, at any hour |
| audit_level = ACCOUNT_LEVEL | Only account-level events (workspace_id 0), dropping workspace-level ones without saying anything about the actor |
Two details affect what you can read. identity_metadata.run_by is the identity that started the event, and run_as is the identity whose permissions authorised it. When an OAuth app acts on a user's behalf, the acting_resource fields name the app. Some keys in request_params that hold SQL definitions are hidden unless you are an account admin or in the databricks_pii_access group. These are view_definition, function_info, definition_json and managed_definition. All other columns are returned unchanged.
Checkpoint 8 of 9· Match them up
During an incident review, a security engineer queries system.access.audit to find out who did what, on whose authority, and when. Match each audit column or value to what it tells the engineer.
Tap a term, then the definition that fits it.
In the audit table, run_by is who started the event and run_as is whose permissions authorised it. The acting_resource fields name an app, such as an OAuth app, that acts for a user. event_date is the column to filter on for faster queries, and account-level events record workspace_id as 0.
“run_by is the identity that initiated the event, and run_as is the identity used for authorization.”Source: docs.databricks.com
Checkpoint 9 of 9· Exam question
A security team suspects that a service principal exported large tables outside normal business hours. They plan to investigate using system.access.audit, which records event_time, service_name, action_name, user_identity, request_params, response, and audit_level for every logged event. Which two filters should they combine to surface the suspicious export events? (Choose two)(Select 2)
Correct answers: A, B — Filter action_name to the export/download action for large result retrievals, and restrict event_time to hours outside the organization's normal working window.; Filter user_identity.email (or application ID) to the specific service principal under investigation, so only that principal's audit trail is examined for the behavior.
- A. Narrowing to the export or download action along with an off-hours time window isolates exactly the class of event the team suspects: a large data retrieval happening when legitimate business activity is unlikely, which is the core signal for this investigation.
- B. Scoping the audit trail to the specific service principal's identity removes noise from unrelated users and workloads, letting the team focus only on the events attributable to the principal under suspicion.
- C. A status code of 200 only means the request completed successfully; it is recorded for logins, queries, and countless benign actions, so filtering on it alone cannot distinguish a table export from any other successful operation.
- D. Cluster lifecycle events describe compute start/stop activity, not data access, so filtering to the clusters service does not reveal which tables were read or exported and misses the actual export action entirely.
- E. Filtering only by the catalog path without also restricting identity or action returns every event touching that path, including unrelated reads and administrative actions, which buries the suspicious export among irrelevant rows.
- F. Audit records are not scoped so that service-principal exports are excluded from workspace-level logging; this filter rests on an incorrect assumption about how the table captures events and would exclude the very rows the team needs.
Sources8
Sources
(8)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“System tables are free to use. You are only charged for the compute used to query them.”
↩︎ What system tables are and who can query them“USE CATALOG on the system catalog, USE SCHEMA on the system schemas, and SELECT on the system schemas”
↩︎ What system tables are and who can query them“System tables are read-only and cannot be modified.”
↩︎ What system tables are and who can query them“they include operational data from non-Unity Catalog workspaces in your account.”
↩︎ What system tables are and who can query them“System tables provide a Databricks-hosted analytical store of your account's operational data.”
↩︎ Key concept“A historical log of SKU pricing. A record gets added each time there is a change to a SKU price.”
↩︎ Checkpoint - 2.
“To see records from another region, you must view the tables from a workspace deployed in that region.”
↩︎ What system tables are and who can query them“The lakeflow schema was previously known as workflow.”
↩︎ Job and pipeline cost with the system.lakeflow tables“The job run timeline, job task run timeline, and pipeline update timeline tables are immutable, so they need no deduplication.”
↩︎ Job and pipeline cost with the system.lakeflow tables“Deletions are recorded as a new row with delete_time populated, not by removing rows.”
↩︎ Job and pipeline cost with the system.lakeflow tables“This key is only unique within a single workspace”
↩︎ Job and pipeline cost with the system.lakeflow tables“For runs longer than one hour that are split across multiple rows”
↩︎ Job and pipeline cost with the system.lakeflow tables“Only unique within a single workspace”
↩︎ Exam trap 2“Apply the delete_time filter after selecting the most recent row”
↩︎ Exam trap 3 - 3.
“Databricks consumption in Databricks units (DBUs)”
↩︎ Reading system.billing.usage - 4.
“The unit of measurement that is monetized.”
↩︎ Reading system.billing.usage“A record gets added each time there is a change to a SKU price.”
↩︎ Turning DBUs into money with system.billing.list_prices“The key default will always return a single price that can be used for simple long-term estimates.”
↩︎ Turning DBUs into money with system.billing.list_prices - 5.
“Records are typically available within 12 hours.”
↩︎ Reading system.billing.usage“The value is ORIGINAL unless the record is related to a correction.”
↩︎ Reading system.billing.usage“Only a subset of these values is populated in any given usage record, depending on the compute type and features used.”
↩︎ Reading system.billing.usage“The identity that created the compute resource. This is not necessarily the compute owner.”
↩︎ Reading system.billing.usage“When the compute's driver and worker nodes use different instance types, their usage appears as separate records”
↩︎ Attributing classic compute spend with system.compute.clusters“Serverless jobs and jobs run on job compute (does not populate for jobs run on all-purpose compute)”
↩︎ Exam trap 1“To attribute usage to the owner, join to system.compute.clusters.owned_by using usage_metadata.cluster_id.”
↩︎ Exam trap 4“Serverless jobs and jobs run on job compute (does not populate for jobs run on all-purpose compute)”
↩︎ Prediction“This is not necessarily the compute owner. To attribute usage to the owner, join to system.compute.clusters.owned_by using usage_metadata.cluster_id.”
↩︎ Checkpoint - 6.
“Defaults to the cluster creator, but can be changed through the Clusters API.”
↩︎ Attributing classic compute spend with system.compute.clusters“All job compute is logged as JOB. Pipelines are PIPELINE or PIPELINE_MAINTENANCE.”
↩︎ Attributing classic compute spend with system.compute.clusters - 7.
“join the usage table with the compute.clusters table to find out which compute resource owners”
↩︎ Attributing classic compute spend with system.compute.clusters - 8.
“To improve query performance, filter on event_date rather than event_time.”
↩︎ Auditing activity with system.access.audit“Account-level audit logs record workspace_id as 0.”
↩︎ Auditing activity with system.access.audit“run_by is the identity that initiated the event, and run_as is the identity used for authorization.”
↩︎ Auditing activity with system.access.audit“Those keys are omitted unless you are an account admin or a member of the databricks_pii_access account-level group”
↩︎ Auditing activity with system.access.audit