Mostrando as tabelas mais consultadas no Postgre

From Basef
Jump to: navigation, search

Para mostrar as tabelas mais consultadas no Postgre:

SELECT 
    relname, 
    idx_tup_fetch + seq_tup_read AS TotalReads 
FROM 
    pg_stat_all_tables
WHERE
    idx_tup_fetch + seq_tup_read != 0
ORDER BY 
    TotalReads DESC
;