Re: Composite Datums containing toasted fields are a bad idea(?) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Composite Datums containing toasted fields are a bad idea(?)
Date
Msg-id 20140421151717.GC14024@alap3.anarazel.de
Whole thread Raw
In response to Re: Composite Datums containing toasted fields are a bad idea(?)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Composite Datums containing toasted fields are a bad idea(?)
List pgsql-hackers
Hi,

On 2014-04-20 15:38:23 -0400, Tom Lane wrote:
> Some poking around with oprofile says that much of the added time is
> coming from added syscache and typcache lookups, as I suspected.
> 
> I did some further work on the patch to make it possible to cache
> the element tuple descriptor across calls for these two functions.
> With the attached patch, the first test case comes down to about 335 ms
> and the second to about 1475 ms (plpgsql is still leaving some extra
> cache lookups on the table).  More could be done with some further API
> changes, but I think this is about as much as is safe to back-patch.

I unfortunately haven't followed this in detail, but shouldn't it be
relatively easily to make this even cheaper by checking for
HEAP_HASEXTERNAL?  If it's not set we don't need to iterate over the
composite's columns, right?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Composite Datums containing toasted fields are a bad idea(?)
Next
From: Tom Lane
Date:
Subject: Re: Composite Datums containing toasted fields are a bad idea(?)