Re: Index only scan and ctid - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Index only scan and ctid
Date
Msg-id 28944.1582035711@sss.pgh.pa.us
Whole thread Raw
In response to Re: Index only scan and ctid  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> For the user visible ctid we could just arbitrarily declare that the ctid
> returned by an IOS is the head of the HOT update chain instead of the tail.

No, I don't think that'd work at all, because that tuple might be dead.
A minimum expectation is that "SELECT ... WHERE ctid = 'xxx'" would return
the same data as the IOS, and that would fail because it wouldn't return
anything.

(In principle I suppose we could *also* redefine what selecting by ctid
means.  Doubt I want to go there though.)

> For a data modifying query -- and it would have to be one targeting some
> other table or else there's no way it could be an IOS -- does having a ctid
> for the head rather than the tail still work?

If you target a tuple that is live according to your current snapshot,
but nonetheless out-of-date, EPQ will chase up to the head for you.
But you gotta start with a tuple that is visible to your snapshot.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Mike Blackwell
Date:
Subject: Re: Parallel copy
Next
From: Ants Aasma
Date:
Subject: Re: Parallel copy