Re: Why does ExecComputeStoredGenerated() form a heap tuple

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Why does ExecComputeStoredGenerated() form a heap tuple
Дата
Msg-id a9e336ae-b4a6-1f8a-0841-8eb1af646df4@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Why does ExecComputeStoredGenerated() form a heap tuple  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Why does ExecComputeStoredGenerated() form a heap tuple  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
On 2019-04-24 00:26, David Rowley wrote:
> I didn't do the exact same test, but if I use COPY instead of \copy,
> then for me patched is faster.

OK, confirmed that way, too.

> For the patch, I wonder if you need this line:
> 
> + memcpy(values, slot->tts_values, sizeof(*values) * natts);
> 
> If you got rid of that and changed the datumCopy to use
> slot->tts_values[i] instead.

done

> Maybe it's also worth getting rid of the first memcpy for the null
> array and just assign the element in the else clause.

Tried that, seems to be slower.  So I left it as is.

> It might also be cleaner to assign TupleDescAttr(tupdesc, i) to a
> variable instead of using the macro 3 times. It'd make that datumCopy
> line shorter too.

Also done.

Updated patch attached.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Parallel Foreign Scans - need advice
Следующее
От: Korry Douglas
Дата:
Сообщение: Re: Parallel Foreign Scans - need advice