Re: What's the best practice to compare the transaction with the checkpoint?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What's the best practice to compare the transaction with the checkpoint?
Дата
Msg-id 1377221.1594050275@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: What's the best practice to compare the transaction with the checkpoint?  (Jialun Zhang <reatank@gmail.com>)
Ответы Re: What's the best practice to compare the transaction with the checkpoint?  (Jialun Zhang <reatank@gmail.com>)
Список pgsql-novice
Jialun Zhang <reatank@gmail.com> writes:
> Actually I am trying to add file support for TOAST. I mean store the
> toasted value in the file system and leave a file path in the toast
> pointer.

Why in the world would that be a good idea?

> Therefore, for garbage collection, we need to remove the file
> after confirming that a deleted tuple is older than the latest checkpoint.

Even granting that shoving each toasted value into its own file is a
sane design, I do not see why you'd need to invent a GC mechanism for it.
Seems like you could drive removal of the file off vacuum's removal of
the parent tuple.

Moreover, even if you want to do it like that, you still don't need to
know whether the deleting transaction is older than the last checkpoint;
indeed that's entirely the wrong question.  What you need to know is
whether it's older than global xmin, so that it's certain no other
transaction will wish to fetch the field value.

            regards, tom lane



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

Предыдущее
От: Jialun Zhang
Дата:
Сообщение: Re: What's the best practice to compare the transaction with the checkpoint?
Следующее
От: Jialun Zhang
Дата:
Сообщение: Re: What's the best practice to compare the transaction with the checkpoint?