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/