Re: Performance question (FOR loop) - Mailing list pgsql-general

From Tom Lane
Subject Re: Performance question (FOR loop)
Date
Msg-id 8664.1125619376@sss.pgh.pa.us
Whole thread Raw
In response to Performance question (FOR loop)  (vishal saberwal <vishalsaberwal@gmail.com>)
List pgsql-general
vishal saberwal <vishalsaberwal@gmail.com> writes:
> The query I am actually trying to optimize is long and has a few joins (for=
> =20
> normalization) and hence didn't copy it here.
> The function structure is similar to the one above.

> (a) Am i right in thinking that if I eliminate the for loop, some=20
> performance gain can be achieved?
> (b) Is there a way to eliminate this for loop?

Is the plpgsql layer actually doing anything useful, or just passing
back the results of the SQL command?  If the latter, use a SQL function
instead.  Or perhaps even better, replace the function by a view.

            regards, tom lane

pgsql-general by date:

Previous
From: vishal saberwal
Date:
Subject: Performance question (FOR loop)
Next
From: "Cristian Prieto"
Date:
Subject: Trouble with bytea in SPI...