Re: [PERFORM] function call vs staright query

2007-03-19 Thread Vincenzo Romano
On Monday 19 March 2007 05:07 Tom Lane wrote: > Vincenzo Romano <[EMAIL PROTECTED]> writes: > > How can I delay the query planner decisions until the actual query is to > > be done inside the function body? > > Use plpgsql's EXECUTE. AFAIR there is no way in a SQL-language function. > >

Re: [PERFORM] function call vs staright query

2007-03-18 Thread Tom Lane
Vincenzo Romano <[EMAIL PROTECTED]> writes: > How can I delay the query planner decisions until the actual query is to be > done inside the function body? Use plpgsql's EXECUTE. AFAIR there is no way in a SQL-language function. regards, tom lane -

Re: [PERFORM] function call vs staright query

2007-03-17 Thread Vincenzo Romano
Hi all again. I've seen that there has been another post similar to mine: http://archives.postgresql.org/pgsql-performance/2007-03/msg00166.php I understand that the query planner has less infos about the query at the time the function is defined / loaded. In my case in the query there is a "fiel

[PERFORM] function call vs staright query

2007-03-17 Thread Vincenzo Romano
Hi all. I'm experiencing a strange behaviour with 8.1.8 (cannot do upgrades to 8.2 at the moment). On a 13+ million rows table I can do a query with results back in less than 100 ms. Result is a set of bigint. But when I encapsulate that query into an "SQL" function with three parameters the resu