Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgres find missing indexes

SELECT relname,
       seq_scan,
       seq_tup_read / seq_scan AS tup_per_scan
FROM pg_stat_user_tables
WHERE seq_scan > 0;

# An index is missing if both the second and third column are big.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #postgres #find #missing #indexes
ADD COMMENT
Topic
Name
3+5 =