From: | John Taylor <postgres(at)jtresponse(dot)co(dot)uk> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: performance problems with subselects |
Date: | 2002-04-23 14:34:18 |
Message-ID: | 02042315341809.01601@splash.hq.jtresponse.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Tuesday 23 April 2002 15:04, Tom Lane wrote:
> John Taylor <postgres(at)jtresponse(dot)co(dot)uk> writes:
> > I am aware that I am using almost the same select from orderheader 3
> > times, but I'm not sure how I can improve on this.
>
> Can you do this?
>
> INSERT INTO target SELECT foo, bar, baz FROM source WHERE condition
>
> To the extent that you are computing multiple fields from the same
> row in the source table, this will help.
Where would I do that ?
Do you mean to select the order number (theorder) into a temporary table ?
The problem is that I need to use the order number in 3 seperate subselects.
>
> Also, avoid that IN construct.
OK. Thats done.
Thanks
JohnT
From | Date | Subject | |
---|---|---|---|
Next Message | Pierre-Alexis Paquin | 2002-04-23 15:45:47 | Database creation problem |
Previous Message | Tom Lane | 2002-04-23 14:04:49 | Re: performance problems with subselects |