From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | vishal saberwal <vishalsaberwal(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Performance question (FOR loop) |
Date: | 2005-09-02 00:02:56 |
Message-ID: | 8664.1125619376@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
vishal saberwal <vishalsaberwal(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2005-09-02 01:16:59 | Re: PL/pgSQL: EXCEPTION NOSAVEPOINT |
Previous Message | Tom Lane | 2005-09-01 23:18:25 | Re: PL/pgSQL: EXCEPTION NOSAVEPOINT |