Re: Idea for getting rid of VACUUM FREEZE on cold pages

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Idea for getting rid of VACUUM FREEZE on cold pages
Дата
Msg-id AANLkTin-c8VQw03gTffjfb_q2iUlU_3EKUbKeqDkWC_v@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Idea for getting rid of VACUUM FREEZE on cold pages  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Idea for getting rid of VACUUM FREEZE on cold pages  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
On Wed, May 26, 2010 at 2:44 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> On 26/05/10 21:35, Josh Berkus wrote:
>> On 5/25/10 10:04 PM, Heikki Linnakangas wrote:
>>> On 25/05/10 23:56, Josh Berkus wrote:
>>>> Do we get a bit in the visibility map for a page which has aborted
>>>> transaction rows on it?
>>>
>>> If there's a tuple with an aborted xmin on a page, the bit in the
>>> visibility map is not set. A tuple with aborted xmax doesn't matter.
>>
>> Then it seems like pages in the visibility map, at least, would not need
>> to be vacuumed or frozen.  Do pages persist in the visibility map
>> indefinitely?
>
> In theory, until any tuple on the page is inserted/updated/deleted again.
> However, we've been operating on the assumption that it's always safe to
> clear any bit in the visibility map, without affecting correctness. I would
> not like to give up that assumption, it makes life easier.

What if we drove it off of the PD_ALL_VISIBLE bit on the page itself,
rather than the visibility map bit?  It would be safe to clear the
visibility map bit without touching the page, but if you clear the
PD_ALL_VISIBLE bit on the page itself then you set all the hint bits
and freeze all the tuples.  In the case where the visibility map bit
gets cleared but the page-level bit is still set, a future vacuum can
notice and reset the visibility map bit.  But whenever the visibility
map bit is set, you know that the page-level bit MUST be set, so you
needn't vacuum those pages, even for anti-wraparound: you know they'll
be frozen when and if they ever get written again.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


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

Предыдущее
От: alvherre
Дата:
Сообщение: Re: mapping object names to role IDs
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Synchronization levels in SR