Pavan Deolasee wrote:
Another thing I noticed is the since VACUUM tries to set the bit in the first phase, it's working only because HOT prunes DEAD tuples just before we do another scan on line pointers (which I had earlier talked about getting rid of. May be its time I do that). Otherwise, the visibility bit won't be set even though the DEAD tuples will be removed in the second scan and the rest are all LIVE tuples. So if we at all want to take out the another scan of line pointers from the first pass, we should rather push the work setting bits in the prune code.
I don't quite understand this paragraph. If there's any DEAD tuples or line-pointers, the all-visible flag can't be set. After an UPDATE or DELETE, it indeed takes two vacuums until the bits in the visibility map are set.
Or did you mean that it only works because the prune phase sets the hint bits on the tuples? HeapTupleSatisfiesVacuum sets them too, so we're not relying on the prune phase to set them.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers