Re: Why does ExecComputeStoredGenerated() form a heap tuple

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does ExecComputeStoredGenerated() form a heap tuple
Date: 2019-05-15 17:44:22
Message-ID: a9e336ae-b4a6-1f8a-0841-8eb1af646df4@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Attachment Content-Type Size
v2-0001-Convert-ExecComputeStoredGenerated-to-use-tuple-s.patch text/plain 5.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Korry Douglas 2019-05-15 17:45:45 Re: Parallel Foreign Scans - need advice
Previous Message Andres Freund 2019-05-15 17:34:20 Re: Parallel Foreign Scans - need advice