Tuples inserted and deleted by the same transaction - Mailing list pgsql-hackers

From Laurenz Albe
Subject Tuples inserted and deleted by the same transaction
Date
Msg-id f6a491b32cb44bb5daaafec835364f7149348fa1.camel@cybertec.at
Whole thread Raw
Responses Re: Tuples inserted and deleted by the same transaction
List pgsql-hackers
Shouldn't such tuples be considered dead right away, even if the inserting
transaction is still active?  That would allow cleaning them up even before
the transaction is done.

There is this code in HeapTupleSatisfiesVacuumHorizon:

        else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetRawXmin(tuple)))
        {
            [...]
            /* inserted and then deleted by same xact */
            if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tuple)))
                return HEAPTUPLE_DELETE_IN_PROGRESS;

Why HEAPTUPLE_DELETE_IN_PROGRESS and not HEAPTUPLE_DEAD?

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Error "initial slot snapshot too large" in create replication slot
Next
From: bt22kawamotok
Date:
Subject: Re: is_superuser is not documented