Re: Set visibility map bit after HOT prune
От | Pavan Deolasee |
---|---|
Тема | Re: Set visibility map bit after HOT prune |
Дата | |
Msg-id | CABOikdOveuJcsbykUgUVGf6dzq7ShNqGeEQsHaSt=Xy64GYUhw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Set visibility map bit after HOT prune (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Thu, Dec 20, 2012 at 12:22 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Pavan Deolasee <pavan.deolasee@gmail.com> writes: > > >> What if we wrap that into the WAL generated by HOT prune itself ? > > What WAL? The case we're worried about here is that there's nothing > else for HOT prune to do. > Does such a case exist ? Or at least, is it that common ? I mean, we have enough checks in place to ensure that HOT prune is attempted only when there is something interesting in the page to be done. Otherwise we don't even attempt getting a cleanup lock on the page. Of course, they are just hints, but they serve very well. Prune XID is what I've in mind in particular. So the fact that the visibility map bit is cleared, it could be because either at least one tuple in the page was updated, deleted or inserted. The first two would have set prune XID and will trigger an HOT action and HOT prune will indeed do something useful. I think aborted non-HOT update may create a scenario that you're talking about i.e. HOT prune will have nothing to do, but the page again turned all-visible. Being an abort path, I wonder if its really that common though. That leaves us with the inserts which will clear the VM bit, but may not have anything for HOT prune to do. But we don't set prune XID for inserts either. So we won't get into hot_page_prune() for such pages. So my point is, for fairly large and common cases, often we will set the bit only when HOT prune did something useful, though not every useful HOT prune will necessarily set the bit. And even if we slip through all the safety nets on HOT prune, we can choose to set the bit only if HOT did something useful to avoid any extra WAL logging assuming we are still worried about those corner cases. Thanks, Pavan -- Pavan Deolasee http://www.linkedin.com/in/pavandeolasee
В списке pgsql-hackers по дате отправления: