Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
От
Pavan Deolasee
Тема
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
Дата
Msg-id
CABOikdMwU8R8L3K6rqisJcK2MPn-3QfS0y_6J=muHvqd9uJKLw@mail.gmail.com
Ответ на
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits (Andres Freund)
Список
Дерево обсуждения
COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Masahiko Sawada <sawada.mshk@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Masahiko Sawada <sawada.mshk@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Masahiko Sawada <sawada.mshk@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Darafei Praliaskouski <me@komzpa.net>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Masahiko Sawada <sawada.mshk@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Re: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits David Steele <david@pgmasters.net>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Simon Riggs <simon@2ndquadrant.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Jeff Janes <jeff.janes@gmail.com>
Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Pavan Deolasee <pavan.deolasee@gmail.com>
Hi,
On Fri, Apr 5, 2019 at 9:05 AM Andres Freund <andres@anarazel.de> wrote:
I think the right approach would be to do all of this in heap_insert and
heap_multi_insert. Whenever starting to work on a page, if INSERT_FROZEN
is specified, remember whether it is either currently empty, or is
already marked as all-visible. If previously empty, mark it as all
visible at the end. If already all visible, there's no need to change
that. If not yet all-visible, no need to do anything, since it can't
have been inserted with COPY FREEZE.
We're doing roughly the same. If we are running INSERT_FROZEN, whenever we're about to switch to a new page, we check if the previous page should be marked all-frozen and do it that way. The special code in copy.c is necessary to take care of the last page which we don't get to handle in the regular code path.
Or are you suggesting that we don't even rescan the page for all-frozen tuples at the end and just simply mark it all-frozen at the start, when the first tuple is inserted and then don't touch the PD_ALL_VISIBLE/visibility map bit as we go on inserting more tuples in the page?
Anyways, if major architectural changes are required then it's probably too late to consider this for PG12, even though it's more of a bug fix and a candidate for back-patching too.
Thanks,
Pavan
Pavan Deolasee http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Pavan Deolasee
Дата: