Re: Extracting only the columns needed for a query

Поиск
Список
Период
Сортировка
От Ashwin Agrawal
Тема Re: Extracting only the columns needed for a query
Дата
Msg-id CALfoeivsmiuC7eJEjyNVBrZV+kG2YP08j_3qU_KWJxvV0RSZ9Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Extracting only the columns needed for a query  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers

On Wed, Jan 15, 2020 at 7:54 AM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> For UPDATE, we need all of the columns in the table because of the
> table_lock() API's current expectation that the slot has all of the
> columns populated. If we want UPDATE to only need to insert the column
> values which have changed, table_tuple_lock() will have to change.

Can you please elaborate on this part? I'm probably missing something,
since I don't see immediately where are those expectations expressed.

The table_tuple_lock() has TupleTableSlot as output argument. Comment for the function states "*slot: contains the target tuple". Usage of table_tuple_lock() in places like ExecUpdate() and GetTupleForTrigger() use the returned tuple for EvalPlanQual. Also, it's unknown within table_tuple_lock() what is expectation and what would be performed on the returned slot/tuple. Hence, it becomes tricky for any AM currently to guess and hence need to return full tuple, as API doesn't state only which columns it would be interested in or just wishes to take the lock and needs nothing back in slot.

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

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Extracting only the columns needed for a query
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Shared memory leak on DSM slot exhaustion