Pruning never visible changes

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Pruning never visible changes
Дата
Msg-id CANbhV-Hhc+-A9OU6m4_-UmrFVg3urgJif-MTtETTkZORkXeqPQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Pruning never visible changes
Список pgsql-hackers
A user asked me whether we prune never visible changes, such as

BEGIN;
INSERT...
UPDATE.. (same row)
COMMIT;

Once committed, the original insert is no longer visible to anyone, so
"ought to be able to be pruned", sayeth the user. And they also say
that changing the app is much harder, as ever.

After some thought, Yes, we can prune, but not in all cases - only if
the never visible tuple is at the root end of the update chain. The
only question is can that be done cheaply enough to bother with. The
answer in one specific case is Yes, in other cases No.

This patch adds a new test for this use case, and code to remove the
never visible row when the changes are made by the same xid.

(I'm pretty sure there used to be a test for this some years back and
I'm guessing it was removed because it isn't always possible to remove
the tuple, which this new patch honours.)

Please let me know what you think.

--
Simon Riggs                http://www.EnterpriseDB.com/

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Следующее
От: Japin Li
Дата:
Сообщение: Re: Error for WITH options on partitioned tables