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)
commit7dfa0ad2ed7b8c783cb251eed607bfd3acaa803d
tree0bd2f75f7e518f5e24d8d1545302f370aa5d8e3a
parent9873fe889d96e7c3fce6ca07d902055c78b4ff53
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