Skip to content

feat(checkers): add unused_index#23

Merged
pirr merged 1 commit into
mainfrom
feat/checker-unused-index
May 5, 2026
Merged

feat(checkers): add unused_index#23
pirr merged 1 commit into
mainfrom
feat/checker-unused-index

Conversation

@pirr

@pirr pirr commented May 5, 2026

Copy link
Copy Markdown
Owner

Flags indexes whose pg_stat_user_indexes.idx_scan is zero — pure write cost (every INSERT/UPDATE maintains the index) for no read benefit.

Excludes correctness-bearing indexes by design: indisprimary, indisunique, indisexclusion, and invalid indexes (failed CONCURRENT builds). Only secondary access-path indexes can be flagged.

Severity is info, matching redundant_index. The cost is real but rarely incident-causing, and stat-window false positives (recently-created index, recent stats reset, replica-only reads, infrequent batch jobs) are easy to trip into. The rule doc walks through how to vet a finding before dropping.

Flags indexes whose pg_stat_user_indexes.idx_scan is zero — pure write
cost (every INSERT/UPDATE maintains the index) for no read benefit.

Excludes correctness-bearing indexes by design: indisprimary,
indisunique, indisexclusion, and invalid indexes (failed CONCURRENT
builds). Only secondary access-path indexes can be flagged.

Severity is info, matching redundant_index. The cost is real but rarely
incident-causing, and stat-window false positives (recently-created
index, recent stats reset, replica-only reads, infrequent batch jobs)
are easy to trip into. The rule doc walks through how to vet a finding
before dropping.
@pirr pirr self-assigned this May 5, 2026
@pirr pirr added the checkers label May 5, 2026
@pirr pirr merged commit df218dc into main May 5, 2026
2 checks passed
@pirr pirr deleted the feat/checker-unused-index branch May 5, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant