Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/health-checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ A check only fires when its conditions are met, so an empty result for any check
- **Tables Larger Than 50GB** - Identifies tables larger than 50GB (but less than 100GB)
- **Query Duration Logging Disabled** - `log_min_duration_statement = -1` so slow queries never get logged
- **Known Bug Affecting Your Version** - Notable non-CVE bugs from PostgreSQL release notes that match your running version (data integrity, replication, vacuum). Covers PG 15-18.
- **Unread Large Constraint-Backing Index** - Large unique or exclusion indexes (>100MB, 0 scans) that are still enforced on every write but never used for reads. The check fires on any `indisunique` or `indisexclusion` index, regardless of whether it backs a constraint. To clear the row: drop the index directly if it is standalone, or drop the underlying unique, primary-key, or exclusion constraint (PostgreSQL does not allow `DROP INDEX` on a constraint-backed index).

## LOW Priority Issues

Expand Down
11 changes: 10 additions & 1 deletion testing/pgTAP/04_medium_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BEGIN;
-- Cache results once; querying inline per-assertion multiplies execution cost by N.
CREATE TEMP TABLE _pgfa_func_results AS SELECT * FROM pg_firstAid();
CREATE TEMP TABLE _pgfa_view_results AS SELECT * FROM v_pgfirstaid;
SELECT plan(18);
SELECT plan(20);

SELECT ok(
(SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Missing FK Index'),
Expand Down Expand Up @@ -85,5 +85,14 @@ SELECT ok(
'View executes Query Duration Logging Disabled check'
);

SELECT ok(
(SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Unread Large Constraint-Backing Index'),
'Function executes Unread Large Constraint-Backing Index check'
Comment thread
randoneering marked this conversation as resolved.
);
SELECT ok(
(SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Unread Large Constraint-Backing Index'),
'View executes Unread Large Constraint-Backing Index check'
Comment thread
randoneering marked this conversation as resolved.
);

SELECT * FROM finish();
ROLLBACK;
11 changes: 11 additions & 0 deletions testing/seed_and_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ def start_session_threads(
"Role Never Logged In",
"Empty Table",
"Index With Very Low Usage",
"Unread Large Constraint-Backing Index",
"Autovacuum Disabled On Table",
}
)

Expand Down Expand Up @@ -738,6 +740,15 @@ def start_session_threads(
"Replication Slots Near Max Wal Size",
"Table Bloat (Detailed)",
"Idle Connections Over 1 Hour",
"Timestamp Without Time Zone",
"Varchar With Length Limit",
"Serial Column Legacy",
"Rules On Tables",
"Query Duration Logging Disabled",
"listen_addresses Wildcard",
"Known CVE Affecting Your Version",
"Known Bug Affecting Your Version",
"Not In With Subquery",
}
)

Expand Down
Loading