Re: [HACKERS] Page Scan Mode in Hash Index

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [HACKERS] Page Scan Mode in Hash Index
Дата
Msg-id CAA4eK1+B59hifDmh_FQs_Tvgx__5s_t=nS4zXPxWNqJAo1q9bg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Page Scan Mode in Hash Index  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] Page Scan Mode in Hash Index  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Sep 20, 2017 at 4:04 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Sep 19, 2017 at 11:34 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> This point has been discussed above [1] and to avoid this problem we
>> are keeping the scan always behind vacuum for unlogged and temporary
>> tables as we are doing without this patch.   That will ensure vacuum
>> won't be able to remove the TIDs which we are going to mark as dead.
>> This has been taken care in patch 0003.  I understand that this is
>> slightly ugly, but the other alternative (as mentioned in the email
>> [1]) is much worse.
>
> Hmm.  So if I understand correctly, you're saying that the LSN check
> in patch 0001 is actually completely unnecessary if we only apply
> 0001, but is needed in preparation for 0003, after which it will
> really be doing something?
>

Right.

> In more detail, I suppose the idea is: a TID cannot be reused until a
> VACUUM has intervened; VACUUM always visits every data page in the
> index; we won't allow a scan to pass VACUUM (and thus possibly have
> one of its TIDs get reused) except when the LSN check is actually
> sufficient to guarantee no TID reuse (i.e. table is not unlogged).

Right.

> Page-at-a-time index vacuum as in _hash_vacuum_one_page doesn't matter
> because such an operation doesn't allow TIDs to be reused.
>

Page-at-a-time index vacuum also allows TIDs to be reused but this is
done only for already marked dead items whereas vacuum can make the
non-dead entries to be removed.  We don't have a problem with
page-at-a-time vacuum as it won't remove any items which the scan is
going to mark as dead.

> Did I get it right?
>

I think so.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] src/test/subscription/t/002_types.pl hanging onparticular environment
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Page Scan Mode in Hash Index