"Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro> writes:
> I use different functions returning setof record, and they are working well.
> The problem is the performance when I use those functions in joins, for
> SELECT *
> FROM "Table1" t1
> JOIN "Function1"( a1, a2, ... aN ) AS f1( ColA int4, ColB
> varchar, ... )
> ON t1.ColX = f1.ColA
> The problem is I'm not able to make indexes on the function, even inside I
> have just another select statement from different permanent tables, with
> some where clauses depending on the function arguments.
There's not a lot you can do about that at the moment. 8.4 will have
the ability to inline functions returning sets, if they're SQL-language
and consist of just a single SELECT, but existing releases won't do it.
You might consider trying to refactor your stuff to use views ...
regards, tom lane
In response to
pgsql-performance by date
|Next:||From: Dimitri Fontaine||Date: 2008-10-09 19:54:47|
|Subject: Re: low performance on functions returning setof record |
|Previous:||From: Sabin Coanda||Date: 2008-10-09 14:47:30|
|Subject: low performance on functions returning setof record|