Re: CTIDs invalidations and dropping columns.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CTIDs invalidations and dropping columns.
Дата
Msg-id 7912.1152588264@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CTIDs invalidations and dropping columns.  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> You're talking about "invalidation" as if it's something someone
> deliberately does. That's incorrect. The t_ctid field is filled in if
> and only if the tuple is exactly the on disk tuple. Otherwise it's a
> new tuple, which by definition does not have a ctid (it doesn't exist
> on disk).

The only way that t_ctid would be "valid" in the result of a SELECT * FROM
is if the "physical tlist" optimization triggers to make the scan skip
the usual ExecProject call and just return a direct pointer to the
on-disk tuple.  That optimization never existed before 8.0 or 8.1
(I forget exactly, but it's pretty recent).  So the OP is depending
on an undocumented, recently added behavior that only applies in one
special case.  To be blunt, the OP's code is broken.  If you want to
know the on-disk tuple's CTID, select it explicitly:SELECT ctid, whatever-else-you-need FROM foo ...
        regards, tom lane


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

Предыдущее
От: Agent M
Дата:
Сообщение: 10th Anniversary Conference
Следующее
От: Katsuhiko Okano
Дата:
Сообщение: poor performance with Context Switch Storm at TPC-W.