I'd like to do something similar to what's described in http://www.bestbrains.dk/Blog/2010/03/25/HowToAssertThatYourSQLDoesNotDoFullTableScans.aspx but for that I'd need postgres to keep track of any full table scans it does. Is there such a thing for postgres?
+2
A:
Have a look at pg_stat_get_numscans(oid)
(number of sequential scans on a table) and the statistics collector (in general).
ChristopheD
2010-03-26 15:23:58
I suppose you mean `pg_stat_get_numscans(oid)`. `SELECT relname, seq_scan FROM pg_stat_user_tables` is a bit easier to use.
Ants Aasma
2010-03-26 15:39:16
That's what I meant yes (refined my post a bit)
ChristopheD
2010-03-26 17:15:58