1 May 2006 11:40
Re: How to return sets from plpythonu functions
2006/4/21, Clodoaldo Pinto <clodoaldo.pinto@...>: > 2006/4/21, Tim Roberts <timr@...>: > > How can that possibly be? The psycopg code is making a brand new > > connection to EXACTLY the same database server, making the same request > > in SQL. I mean, I hear what you are saying, but unless the procedure is > > doing a lot of extra processing beyond simple SQL statements, I find it > > almost impossible to believe that adding a Python layer could improve > > the performance. > > The function does a lot of distinct, max(), min() and avg(). I > suspect, given what I have already seen, that doing it in Python will > be more efficient. > > I have some plpythonu functions, none returning rows. They do lots of > computing and are sure much faster than sql or plpgsql. They are > called only once in a batch processing so the psycopg load is not > important. This new one will be called from a web page so your point > is significant. I did not know about plpy. I will give it a try. > > One of the functions was greatly accelerated just by changing from > PyGreSQL to psycopg: > > http://lists.initd.org/pipermail/psycopg/2005-September/003816.html > http://lists.initd.org/pipermail/psycopg/2005-October/003994.html > My findings: The pure sql function sql() takes 630 ms. The plpythonu function py() takes 319 ms.(Continue reading)
Regards
Federico Di Gregorio wrote:
>Il giorno mar, 09/05/2006 alle 16.14 +0530, Kenneth Gonsalves ha
>scritto:
>
>
>>On Tuesday 09 May 2006 4:03 pm, Federico Di Gregorio wrote:
>>
>>
>>>Il giorno mar, 09/05/2006 alle 18.14 +0800, 王磊 ha scritto:
>>>
>>>
>>>>lobject-branch is the only way?
>>>>
>>>>
>>>Yes, and it was even abandoned by its author.
>>>
>>>
>>LOL
>>
>>
>
>Well.. this is the first time I talk about psycopg's author in third
>person and it is not me. :D Marco! Is that branch really orphaned?
>
>federico
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Psycopg mailing list
>Psycopg <at> lists.initd.org
>
RSS Feed