Re: modifying the tbale function - Mailing list pgsql-hackers

From Neil Conway
Subject Re: modifying the tbale function
Date
Msg-id 45FDC3F5.5060701@samurai.com
Whole thread Raw
In response to Re: modifying the tbale function  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: modifying the tbale function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Andrew Dunstan wrote:
> I'm not convinced it would be a huge gain anyway. Switching madly in 
> and out of the perl interpreter at least is a known performance 
> problem, IIRC

Returning control to the backend for every row returned would likely be 
excessive, but you could return once every k rows and get most of the 
benefits of both approaches (k might be on the order of 1000). The 
problem with the current approach is that it makes returning large 
result sets from PL functions very expensive, since they need to be 
spooled to disk.

As for using threads, that's pretty much a non-starter: we can't safely 
allow calls into the backend from multiple concurrent threads, and I 
doubt that will chance any time soon.

-Neil



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: modifying the tbale function
Next
From: "Islam Hegazy"
Date:
Subject: Re: modifying the tbale function