Re: 64-bit XIDs again

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: 64-bit XIDs again
Дата
Msg-id CANP8+j+=8gHLJRAbHTff0+MFqydH6oNqp0Hi1qB5+xYR534VOg@mail.gmail.com
обсуждение исходный текст
Ответ на 64-bit XIDs again  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Список pgsql-hackers
On 30 July 2015 at 14:26, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
 
As I mentioned in CSN thread, it would be nice to replace XID with CSN when setting hint bits for tuple. In this case when hint bits are set we don't need any additional lookups to check visibility.
http://www.postgresql.org/message-id/CAPpHfdv7BMwGv=OfUg3S-jGVFKqHi79pR_ZK1Wsk-13oZ+cy5g@mail.gmail.com
Introducing 32-bit CSN doesn't seem reasonable for me, because it would double our troubles with wraparound.

Your idea to replace XIDs with CSNs instead of hinting them was a good one. It removes the extra-lookup we thought we needed to check visibility with CSN snapshots.

I agree 32-bit CSNs would not be a good idea though, a 64-bit CSN is needed.

If we break a CSN down into an Epoch and a 32-bit value then it becomes more easily possible. The Epoch for XID and CSN can be the same - whichever wraps first we just increment the Epoch.

By doing this we can reuse the page-level epoch for both XID and CSN. Now hinting a tuple is just replacing a 32-bit XID with a 32-bit CSN. 

We would probably need an extra flag bit for the case where the CSN is one epoch later than the XID.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: checkpointer continuous flushing
Следующее
От: Andres Freund
Дата:
Сообщение: GinPageIs* don't actually return a boolean