Find unused Databricks tables
A table with no read observed still costs its refresh and its storage. Unity Catalog lineage lets you spot them. Here is how, what that signal is worth, and what YALineo does.
What a table with no readers still costs
A table without readers keeps costing as long as nothing stops it. The job or pipeline that writes it still runs, and each run is billed. Its files take up storage.
The refresh is in system.billing.usage, under the name of the job or pipeline, and under the table's name only for a materialized view. It therefore has to be shared between the tables written, as the guide on the cost of a table explains. The storage of a table kept in your cloud account is billed by your cloud provider, outside system.billing.usage. The default storage of a serverless workspace is billed by Databricks (product DEFAULT_STORAGE), aggregated at the metastore level and so not table by table.
A table neither read nor written costs only its storage. One that is rewritten every day for nobody costs both: that is the one to find first.
The system tables to read
Two sources are enough, both read only:
| Source | What it brings |
|---|---|
system.access.table_lineage | One row per read or write that Unity Catalog could trace: source, target, direct_access, event_date |
system.information_schema.tables | The tables of every catalog in the metastore that you are allowed to see, with table_type, table_owner and last_altered |
Unless you are both account admin and metastore admin, an admin has to grant you USE CATALOG on the system catalog, then USE SCHEMA and SELECT on its schemas.
Step 1: the reads of each table
A table is read when it is the source of a lineage row (source_table_full_name). According to the documentation, a source with no target is a read only, and a source with a target is a read that writes something else: both are uses.
direct_access is false when the source was found by expanding a view: a query on a view leaves one row for the view and one for each table under it. Keep those rows to know whether a table is used, or a table read only through a view will look forgotten. Keep the direct rows to count reads without duplicates. Always filter on event_date, the partition column:
SELECT source_table_full_name AS table_read,
COUNT_IF(coalesce(direct_access, true)) AS direct_reads,
COUNT_IF(direct_access = false) AS rows_through_a_view,
MAX(event_date) AS last_read
FROM system.access.table_lineage
WHERE event_date >= date_sub(current_date(), 90)
AND source_table_full_name IS NOT NULL
GROUP BY ALL
Step 2: the tables with no read at all
Next, start from the inventory and keep the tables that are the source of no row, with their last observed write and their days written:
WITH lineage AS (
SELECT source_table_full_name, target_table_full_name, event_date, event_time
FROM system.access.table_lineage
WHERE event_date >= date_sub(current_date(), 90)
),
read_tables AS (
SELECT DISTINCT source_table_full_name AS full_name
FROM lineage
WHERE source_table_full_name IS NOT NULL
),
written_tables AS (
SELECT target_table_full_name AS full_name,
MAX(event_time) AS last_write,
COUNT(DISTINCT event_date) AS days_written
FROM lineage
WHERE target_table_full_name IS NOT NULL
GROUP BY ALL
)
SELECT t.table_catalog, t.table_schema, t.table_name, t.table_type, t.table_owner,
w.last_write, w.days_written
FROM system.information_schema.tables AS t
LEFT JOIN read_tables AS r
ON r.full_name = concat_ws('.', t.table_catalog, t.table_schema, t.table_name)
LEFT JOIN written_tables AS w
ON w.full_name = concat_ws('.', t.table_catalog, t.table_schema, t.table_name)
WHERE r.full_name IS NULL
AND t.table_type <> 'VIEW'
AND t.table_catalog <> 'system'
AND t.table_schema <> 'information_schema'
ORDER BY w.days_written DESC NULLS LAST
Views store nothing and are left out, like the system catalog and the information_schema schemas. The tables written most often with no reader come first. With no last write, the table was neither read nor written over the window, or it was written outside the lineage.
Step 3: the last write, and why last_altered is not one
The last observed write is the latest moment the table is the target of a lineage row. A write the lineage does not capture is not in it.
The documentation defines last_altered as the time the relation definition was last altered. Reading a table does not change its definition: this date tells nothing about reads. The page does not say that a data write updates it either. YALineo treats it as a definition date.
What this signal proves and what it does not
A table missing from the lineage sources had, over the window, no read that Unity Catalog could trace. The query establishes nothing more.
- The lineage is a subset. According to Databricks, its tables are a subset of all read and write events, and a record is only emitted when lineage can be inferred.
- A read outside Databricks leaves no row. Unity Catalog captures lineage for queries run on Databricks. An outside engine that reads the files in storage, or an exported copy read elsewhere, does not show up.
-
An external table read by its path leaves the path in
source_path, not the table name. - Some cases are not captured. Databricks names RDDs and global temp views. The lineage of a renamed table is not kept.
- The window is bounded. Lineage tables keep a rolling 395 days by default. A table read once a quarter will look forgotten over 30 days.
-
Your permissions limit the inventory.
information_schema.tablesonly returns the tables you are allowed to see.
Before you drop a table
- Widen the window up to the longest periodic use: month-end close, quarterly committee, annual report. Beyond the 395 days, Catalog Explorer and the lineage API keep the lineage captured since 1 September 2024.
-
Look for invisible reads: a
source_paththat points to the table's folder, a tool that reads the storage without going through Databricks. -
Confirm with the owner (
table_owner) and the teams that use its data. - Plan a deprecation period. Announce a date, mark the table with a comment or a tag, then stop its refresh and keep its data. A forgotten reader can then speak up without losing anything. Drop it after a full cycle of the longest use.
-
Know how to go back.
UNDROP TABLErecovers a dropped table for 7 days by default. For an external table, only the metadata is removed: the files stay in your storage, and so does their cost.
What YALineo does
YALineo reads the lineage and the billing in your browser, with your Databricks permissions, read only, with no YALineo server.
A table has "no read observed" when its refresh over the period is above zero and no read of it is seen, neither direct nor through a view. A view never enters this list. The period runs from 7 to 365 days, or between two dates (filters).
- "Tables" ("Costs" section): the "Only tables with no read observed" box keeps these tables, with their refresh, their cost "Per month" (average month of 365/12 days), its precision and the job or pipeline that pays for it. The list exports to CSV. The overview's "Tables with no read observed" card gives their number and their total per month.
- "Findings": each table becomes a "No read observed" finding, with a potential amount "to confirm" and your follow-up ("To review", "Checked by me", "Ignored").
- Health check: the "Not read in the period" check flags candidates for a review, never for automatic deletion.
This amount is the refresh only: storage billed by the cloud is not in YALineo's totals. It is a cost attributed under the calculation method, to check with the owner, and it only becomes a saving once the refresh is stopped. The last write comes from the lineage, never from last_altered (freshness). The limits of the read count are in the known limits, the walkthrough in the tutorial.
Frequently asked questions
Does a table read only through a view count as read?
Yes. The lineage records the table under the view with direct_access = false, and YALineo counts the read of the view once for each of its sources.
Does a BI tool connected to a SQL warehouse leave a trace?
Yes, when lineage can be inferred. A JDBC query leaves a row whose entity_metadata is empty, since no Databricks object is involved, but the read is there. A tool that reads the storage files directly leaves none.
Is the Catalog Explorer popularity enough?
The Insights tab of a table shows its usage over the last 30 days, and its popularity reflects how often it is queried over that time. It is a good check for one given table. According to the page, popularity counts the interactive reads of the table, including reads from JDBC, the SQL Statement Execution API, SQL connectors and sample data clicks in Catalog Explorer; the page does not say exactly how the number is computed, nor whether a read through a view counts for the view's tables. Popularity can differ a lot from the lineage count (what Databricks shows).
Sources
Documentation read on 6 November 2026.
-
Databricks, Lineage system tables reference (page updated on 4 November 2026):
source_typeandtarget_type,direct_access,event_date, subset of events, paths, JDBC query, 395 days. - Databricks, Lineage in Unity Catalog (page updated on 4 November 2026): queries run on Databricks, limitations, history since 1 September 2024.
- Databricks, System tables reference (page updated on 4 November 2026): permissions to grant.
-
Databricks, TABLES (page updated on 11 September 2026):
last_altered,table_owner,table_type, rows limited to your permissions. -
Databricks, Information schema (page updated on 11 September 2026):
system.information_schemacovers every catalog. -
Databricks, Billable usage system table reference (page updated on 5 November 2026):
uc_table_*fields filled for materialized views. -
Databricks, Monitor default storage costs (page updated on 11 September 2026):
DEFAULT_STORAGE, usage aggregated at the metastore level. - Databricks, Create a serverless workspace (page updated on 9 October 2026): external storage billed by the cloud provider.
-
Databricks, DROP TABLE (page updated on 4 November 2026):
UNDROP TABLE, external table. - Databricks, View table insights and popularity (page updated on 6 October 2026): Insights tab, popularity over 30 days and the reads it counts.