[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Was: Triggers, Stored Procedures, PHP
From:       Alvaro Herrera <alvherre () dcc ! uchile ! cl>
Date:       2003-11-30 23:42:53
[Download RAW message or body]

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 I would certainly love to have parameterised views :)

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
parametrized views instead of functions the whole mess would probably be
more optimal.

Maybe there's a TODO here?

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Ninguna manada de bestias tiene una voz tan horrible como la humana" (Orual)

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic