Re: Pinning a buffer in TupleTableSlot is unnecessary

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Pinning a buffer in TupleTableSlot is unnecessary
Дата
Msg-id 30057.1479136992@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Pinning a buffer in TupleTableSlot is unnecessary  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Pinning a buffer in TupleTableSlot is unnecessary
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Nov 12, 2016 at 10:28 AM, Andres Freund <andres@anarazel.de> wrote:
>> On 2016-08-30 07:38:10 -0400, Tom Lane wrote:
>>> I think this is probably wrong, or at least very dangerous to remove.
>>> The reason for the feature is that the slot may continue to point at
>>> the tuple after the scan has moved on.

>> FWIW, that's not safe to assume in upper layers *anyway*. If you want to
>> do that, the slot has to be materialized, and that'd make a local
>> copy. If you don't materialize tts_values/isnull can point into random
>> old memory (common e.g. for projections and virtual tuples in general).

> So, I think you are arguing in favor of proceeding with this patch?

I don't believe Andres' claim anyway.  There are certainly cases where an
allegedly-valid slot could be pointing at garbage, but table scans aren't
one of them, precisely because of the pin held by the slot.  It would take
a fairly wide-ranging code review to convince me that it's okay to lose
that mechanism.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Something is broken about connection startup
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Something is broken about connection startup