On Thu, Jan 5, 2017 at 6:51 AM, Amit Kapila <amit.kapil...@gmail.com> wrote:
> UNDO has to be kept till heap page is marked as all visible. This is
> required to check the visibility of index. Now, I think the page can
> be marked as all visible when we removed corresponding dead entries in
> heap. I think the main point of discussion here is how vacuum will
> clean heap and index entries in this new system. Another idea could
> be that we allow undo entries to be removed (we can allow heap entry
> to be removed) based on if they are visible or not and then while
> traversing index we cross check in heap if the entry can be removed.
> Basically, check the TID and traverse undo contents if any to verify
> if the index entry can be removed. I think this sounds to be more
> complicated and less efficient than what I suggested earlier.
In my proposal, when a tuple gets updated or deleted in the heap, we
go find the corresponding index entries and delete-mark them. When an
index tuple is delete-marked, we have to cross-check it against the
heap, because the index tuple might not match the version of the heap
tuple that our snapshot can see. Therefore, it's OK to discard the
heap page's UNDO before cleaning the indexes, because the index tuples
are already delete-marked and rechecks will therefore do the right
In short, I agree with Dilip.
The Enterprise PostgreSQL Company
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: