This commit is contained in:
@@ -6,6 +6,15 @@ http://okigiveup.net/what-postgresql-tells-you-about-its-performance/
|
||||
|
||||
|
||||
Useful queries to indicate how indexes are being used in postgresql
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
OK: this is the best query to use to find non used indexes
|
||||
Run it and look for any indexes that are *not* primary keys (name ends in pkey, want ones that end in idx which are mine)
|
||||
that have zero in idx_scan, that means they are completely unused (if a lot of full test runs that excercise all routes and features have happened prior to checking)
|
||||
|
||||
SELECT * FROM pg_stat_user_indexes order by idx_scan asc
|
||||
|
||||
Following queries might be useful but for different purposes...
|
||||
|
||||
This is a test query I used with widget and name fetching performance analysis:
|
||||
explain analyze SELECT m.name
|
||||
|
||||
Reference in New Issue
Block a user