Mostrando as tabelas mais consultadas no Postgre

From Basef
Revision as of 16:15, 26 August 2016 by Admin (Talk | contribs) (Criou página com 'Para mostrar as tabelas mais consultadas no Postgre: <source lang="sql"> SELECT relname, idx_tup_fetch + seq_tup_read as TotalReads FROM pg_stat_all_tables WH...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
;