Teach ANALYZE to distinguish dead and in-doubt tuples, which it formerly
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Apr 2008 16:27:32 +0000 (16:27 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Apr 2008 16:27:32 +0000 (16:27 +0000)
commit8bcc7115c39295ea8b651f4c0e9329ca1fe183fe
tree8541630860d4285e175460abb3c115de725be4d0
parent209ed3857934dc7118b8487c083a04fca27153e2
Teach ANALYZE to distinguish dead and in-doubt tuples, which it formerly
classed all as "dead"; also get it to count DEAD item pointers as dead rows,
instead of ignoring them as before.  Also improve matters so that tuples
previously inserted or deleted by our own transaction are handled nicely:
the stats collector's live-tuple and dead-tuple counts will end up correct
after our transaction ends, regardless of whether we end in commit or abort.

While there's more work that could be done to improve the counting of in-doubt
tuples in both VACUUM and ANALYZE, this commit is enough to alleviate some
known bad behaviors in 8.3; and the other stuff that's been discussed seems
like research projects anyway.

Pavan Deolasee and Tom Lane
src/backend/commands/analyze.c
src/backend/postmaster/pgstat.c
src/include/pgstat.h