From: | "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com> |
---|---|
To: | "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> |
Cc: | "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>, "Bruce Momjian" <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: HOT WIP Patch - version 1 |
Date: | 2007-02-15 11:19:46 |
Message-ID: | 2e78013d0702150319x63670522u5cd5d7cf80a4e100@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2/15/07, Heikki Linnakangas <heikki(at)enterprisedb(dot)com> wrote:
>
> Do we actually ever want to remove dead tuples from the middle of the
> chain? If a tuple in the middle of the chain is dead, surely every tuple
> before it in the chain is dead as well, and we want to remove them as
> well. I'm thinking, removing tuples from the middle of the chain can be
> problematic, because we'd need to fiddle with the xmin/xmax of the other
> tuples to make them match. Or change the tuple-following logic to not do
> the xmin=xmax check, but it's a nice robustness feature.
I am precisely working on this right now. In the next patch version that I
intend to send shortly, I am thinking of removing the dead tuples in the
middle of the chain. We don't have agreement on how to deal with the
root tuple, but we can safely remove the intermediate dead tuples and
vacuum them. Also when all the tuples in the chain are dead because the
last tuple is either deleted or COLD updated, the entire chain along with
the root tuple and the index entry can be vacuumed.
The operation must be WAL logged and you caught the xmin/xmax
problem very rightly. One option is to change the xmax of root tuple
to the xmin of the first live/recently-dead tuple, if we remove a set of
intermediate dead tuples. This xmin of the first live/recently-dead tuple
is also the xmax of the last dead tuple we removed and hence must
be older than the oldtestXmin. So assigning that to the root tuple
should not break any visibility rules for the root tuple (it would still
be dead).
Do we see any problem with this ?
Thanks,
Pavan
--
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Hideyuki Kawashima | 2007-02-15 12:31:14 | Re: Acclerating INSERT/UPDATE using UPS |
Previous Message | Heikki Linnakangas | 2007-02-15 10:49:31 | Re: HOT WIP Patch - version 1 |