Commande sql pour voir l'utilisation des index :

SELECT s.schemaname,  
       s.relname AS nom_table,
       s.indexrelname AS nom_index,
       pg_relation_size(s.indexrelid) AS taille_index,
       s.idx_scan AS nombre_de_scan
FROM pg_catalog.pg_stat_user_indexes s
   JOIN pg_catalog.pg_index i ON s.indexrelid = i.indexrelid
WHERE s.idx_scan <= 5     -- n'a jamais été scanné
  AND 0 <>ALL (i.indkey)  -- aucune colonne d'index n'est une expression
  AND NOT EXISTS          -- n'impose pas de contrainte
         (SELECT 1 FROM pg_catalog.pg_constraint c
          WHERE c.conindid = s.indexrelid) and s.relname  like '%%'
ORDER BY pg_relation_size(s.indexrelid) DESC;