PostgreSQL

Excessive indexes on nonpartitioned tables cause fast path lock exhaustion

warning
configurationUpdated Jul 30, 2025
Technologies:
How to detect:

Tables with 20+ B-tree indexes force queries to acquire locks on each index, even if unused by the query. A simple SELECT on a table with 20 indexes can exhaust the 16-slot fast path limit, triggering slow path locking and LWLock:LockManager contention.

Recommended action:

Audit table indexes using pg_stat_user_indexes to identify unused indexes (idx_scan = 0). Drop unnecessary indexes that don't improve query performance. Consolidate multiple single-column indexes into composite indexes where appropriate. Keep total indexes per table under 16 to avoid fast path exhaustion on read queries.