Re: [HACKERS] [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-12-01 Thread Greg Stark
Joe Conway [EMAIL PROTECTED] writes: How is a parameterized view any different than a set returning SQL function? In either case, you've got the same work to do to teach the optimizer how to understand it, no? Seems like the todo is just that, teach the optimizer how to do better with

Re: [HACKERS] [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-30 Thread Alvaro Herrera
On Mon, Dec 01, 2003 at 09:38:06AM +1100, Alex Satrapa wrote: create or replace function get_transactions (INTEGER) returns set of record as ' DECLARE cust_id ALIAS FOR $1; BEGIN for r in select ... from ... loop return next r; end loop; return; END ' language 'plpgsql'; But

Re: [HACKERS] [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-30 Thread Joe Conway
Alvaro Herrera wrote: Me too. I've created many functions to extract data that are joined to other functions. All in all the result is not as optimal as it could be, because the optimizer can not poke into the functions, and the estimates about functions are only guesses. If one could use