find_unused_columns
Identify database columns with zero or stale query traffic using runtime logs, excluding primary keys and audit fields, to find unused columns for cleanup.
Instructions
Surface columns with zero or stale runtime traffic. Reads runtime_query_calls (populated by ingest_sql_log) and surfaces columns that haven't been queried within window_days. Excludes primary-key candidates and audit fields (created_at / updated_at / dbt_*) by default. Refuses to run with explicit error when no runtime data has been ingested — would otherwise trivially flag every column.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| min_calls | No | Floor for 'considered used' within window. Default 0. | |
| dataset_id | Yes | ||
| exclude_pk | No | Skip primary-key candidates. Default true. | |
| window_days | No | Look-back window. Default 30. | |
| exclude_audit | No | Skip audit columns (created_at, updated_at, dbt_*, etc). Default true. |