Re: Quick question regarding HeapTupleHeaderData.t_ctid

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Quick question regarding HeapTupleHeaderData.t_ctid
Дата
Msg-id CAJ7c6TOOV6ASi-tUx1-hfrhXW_btCZTv8zYkBhLUTCqrJAxOaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Quick question regarding HeapTupleHeaderData.t_ctid  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Quick question regarding HeapTupleHeaderData.t_ctid  (Aleksander Alekseev <aleksander@timescale.com>)
Список pgsql-hackers
Hi Tom,

> > Which brings a question, maybe it shouldn't
> > take that much space on disk.
>
> How would you make it optional?  In particular, what are you going to
> to when it's time to update a row (and therefore insert a ctid link)
> and the page is already completely full?

In other words, if I have an ItemPointer to an old tuple and try to
UPDATE it, t_ctid allows me to find the next page with another HOT
chain and, if possible, add a new tuple to that HOT chain. And
although there are newer versions of the tuple they are not
necessarily alive, e.g. if the corresponding transactions were
aborted, or they are running and it's not clear whether they will
succeed or not. I didn't think about this scenario.

It also explains why t_ctid can't be variable in size depending on
whether it points to a tuple in the same page or in the different one.
Next time we change t_ctid its size may change which will require
resizing the tuple, and the whole story becomes very complicated.

I think I get it now. Many thanks!

Just to clarify, is t_ctid used for anything _but_ HOT?

-- 
Best regards,
Aleksander Alekseev



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Quick question regarding HeapTupleHeaderData.t_ctid
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Quick question regarding HeapTupleHeaderData.t_ctid