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 4575.1404075243@sss.pgh.pa.us
Whole thread Raw
In response to Re: Array of composite types returned from python  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Responses Re: Array of composite types returned from python  ("Behn, Edward (EBEHN)" <EBEHN@arinc.com>)
Re: Array of composite types returned from python  (Ronan Dunklau <ronan.dunklau@dalibo.com>)
List pgsql-hackers
Abhijit Menon-Sen <ams@2ndQuadrant.com> writes:
>> 3) This is such a simple change with no new infrastructure code
>> (PLyObject_ToComposite already exists). Can you think of a reason
>> why this wasn't done until now? Was it a simple miss or purposefully
>> excluded?

> This is not an authoritative answer: I think the infrastructure was
> originally missing, but was later added in #bc411f25 for OUT parameters.
> Perhaps it was overlooked at the time that the same code would suffice
> for this earlier-missing case. (I've Cc:ed Peter E. in case he has any
> comments.)

> I think the patch is ready for committer.

I took a quick look at this; not really a review either, but I have
a couple comments.

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.

2. I wonder whether the no-composites restriction in plpy.prepare
(see lines 133ff in plpy_spi.c) could be removed as easily.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: SKIP LOCKED DATA (work in progress)
Next
From: Andres Freund
Date:
Subject: Re: idle_in_transaction_timeout