I've got a bunch of tables in a legacy database that I know are
never used, and some more I'm not sure about. So I tried to
identify and confirm with:
select pg_stat_reset();
-- Wait a long time
select * from pg_stat_all_tables where schemaname='public' order by
seq_scan,seq_tup_read;
select greatest(heap_blks_read,heap_blks_hit),relname from
pg_statio_all_tables where schemaname='public' order by 1 desc;
But I think I'm getting clutter from the nightly backups. Is there a
way to keep pg_dump activity out of the statistics? I can think of
several reasons to want such activity excluded, not just this one.