Re: Array of composite types returned from python - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Array of composite types returned from python
Date
Msg-id 21954.1404280514@sss.pgh.pa.us
Whole thread Raw
In response to Re: Array of composite types returned from python  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
Responses Re: Array of composite types returned from python  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Ronan Dunklau <ronan.dunklau@dalibo.com> writes:
> Le dimanche 29 juin 2014 16:54:03 Tom Lane a =E9crit :
>> 1. While I think the patch does what it intends to, it's a bit distressing
>> that it will invoke the information lookups in PLyObject_ToComposite over
>> again for *each element* of the array.  We probably ought to quantify that
>> overhead to see if it's bad enough that we need to do something about
>> improving caching, as speculated in the comment in PLyObject_ToComposite.

> I don't know how to do that without implementing the cache itself.

I don't either, but my thought was that we could hack up a simple
one-element cache pretty trivially, eg static info and desc variables
in PLyObject_ToComposite that are initialized the first time through.
You could only test one composite-array type per session with that
sort of kluge, but that would be good enough for doing some simple
performance testing.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: 9.5 CF1
Next
From: Michael Paquier
Date:
Subject: Re: WAL format and API changes (9.5)