Re: Why do we expand tuples in execMain.c?

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why do we expand tuples in execMain.c?
Date: 2018-08-08 20:03:17
Message-ID: 9cda6809-290b-c747-14d2-3263bd4b407a@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/08/2018 12:20 AM, Andres Freund wrote:
> Hi,
>
> I noticed
> if (HeapTupleHeaderGetNatts(tuple.t_data) <
> RelationGetDescr(erm->relation)->natts)
> {
> copyTuple = heap_expand_tuple(&tuple,
> RelationGetDescr(erm->relation));
> }
> else
> {
> /* successful, copy tuple */
> copyTuple = heap_copytuple(&tuple);
> }
>
> in EvalPlanQualFetchRowMarks, and I'm somewhat confused why it's there?
> If it's required here, why isn't it required in dozens of other places?
>
>

Not dozens, I think, since you can't have short records for catalog
tables, which account for most of the calls to heap_copytuple().

I will look at the remainder of cases (less than 10) and reply in a day
or two.

cheers

andrew

--

Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-08-08 20:29:29 Re: [HACKERS] proposal: schema variables
Previous Message Tomas Vondra 2018-08-08 19:47:17 Re: memory leak when serializing TRUNCATE in reorderbuffer