COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
Дата
Msg-id CABOikdN-ptGv0mZntrK2Q8OtfUuAjqaYMGmkdU1dCKFtUxVLrg@mail.gmail.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  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-hackers
Hi,

Jeff Janes raised an issue [1] about PD_ALL_VISIBLE not being set correctly while loading data via COPY FREEZE and had also posted a draft patch.

I now have what I think is a more complete patch. I took a slightly different approach and instead of setting PD_ALL_VISIBLE bit initially and then not clearing it during insertion, we now recheck the page for all-frozen, all-visible tuples just before switching to a new page. This allows us to then also mark set the visibility map bit, like we do in vacuumlazy.c

Some special treatment is required to handle the last page before bulk insert it shutdown. We could have chosen not to do anything special for the last page and let it remain unfrozen, but I thought it makes sense to take that extra effort so that we can completely freeze the table and set all VM bits at the end of COPY FREEZE.

Let me know what you think.

Thanks,
Pavan  


--
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: RE: Timeout parameters
Следующее
От: Pavan Deolasee
Дата:
Сообщение: Re: [HACKERS] COPY FREEZE and PD_ALL_VISIBLE