News for hackers. Stuff that matters.
Re:How Postgres Makes Transactions Atomic by petergeoghegan on Wednesday August 16, 2017 @08:24PM (#15032609)
That is correct.

There is one small inaccuracy in your summary, which is that a structure called the visibility map summarizes if a heap page is all visible; that's how index only scans work. At no point do we mark an index page as all-visible, because a HOT update would invalidate that.

Re:How Postgres Makes Transactions Atomic by felixge on Thursday August 17, 2017 @01:17AM (#15033985)
Thanks for the clarification about the visibility map.

That being said, I don't understand why HOT would interfere with a hypothetical mechanism for marking index pages as all-visible. If a tuple gets a HOT update, I think the index values should remaing unchanged? And if they do, shouldn't their visibility on an all-visible index page remain unchanged as well?

Unrelated: Thank you so much for your work on "UPSERT" :)

Re:How Postgres Makes Transactions Atomic by petergeoghegan on Thursday August 17, 2017 @02:25AM (#15034221)
I guess that I said HOT UPDATE because you talked about HOT. What you describe goes against how visibility information is maintained. There is an interlock between indexes and tables for VACUUM that would have to be considered. It would be hard to set an all-visible bit on a leaf page in a race-free manner.

A much simpler way of putting it would be that deletes would have to touch indexes if summarized visibility info was stored in indexes, even in cases where overall there is hardly any benefit from putting per-page visibility information in index pages. It's not impossible to make something like this work, but it's not obviously compatible with the current design.

I'm glad that you found UPSERT useful.

Re:How Postgres Makes Transactions Atomic by felixge on Thursday August 17, 2017 @03:51AM (#15034608)
I wasn't really proposing to change how visibility information is maintained, my grasp on the internals is far to weak for that :). I just tried to make sure I understood your comment, which I think I do now. So thanks again for another insightful reply :)