Skip to main content

Index Recommendations (Basics)

pgpulse analyzes your query patterns and automatically suggests indexes that could improve performance.

When NOT to add an index​

Indexes aren't free. Every index adds overhead to your INSERT, UPDATE, and DELETE operations.

  • Avoid indexing columns with very low cardinality (e.g., a "gender" column with only two values).
  • Don't add indexes that are rarely used (verify this in pgpulse).
  • Watch out for redundant indexes (e.g., indexing (a, b) and then also indexing (a) separately).

Safe Rollout​

  1. Create Concurrently: Always use CREATE INDEX CONCURRENTLY on production databases. It takes longer but doesn't block writes.
  2. Watch Write Overhead: Monitor your IO and CPU after adding an index to ensure you haven't traded read performance for write bottlenecks.
  3. Verify Usage: After a few days, check pgpulse to see if the new index is actually being used by your queries.