| From: | John Taylor <postgres(at)jtresponse(dot)co(dot)uk> | 
|---|---|
| To: | Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org> | 
| Subject: | Re: optimising data load | 
| Date: | 2002-05-23 07:01:42 | 
| Message-ID: | 02052308014200.31556@splash.hq.jtresponse.co.uk | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
On Thursday 23 May 2002 03:40, Ron Johnson wrote:
> On Wed, 2002-05-22 at 16:05, John Taylor wrote:
>
> > So, how would I merge the data from the view with the data to copy in ?
> 
> ???  Unless I am misunderstanding you:
I think you are misunderstanding me.
I have 300,000 rows to insert.
They each require a different query to obtain the correct data to insert.
> 
> 0. create view v_new_orderlines (theorder, type, stock, line,
>        ordercurrent, sellingquant, price, discount, vatrate, comment)
>    as  SELECT oh.theorder, 'P', '0310', coalesce(ol.line+1,1), 5, 0,
>               .52, 0, 0, ''
>        FROM orderheader oh 
>                LEFT OUTER JOIN orderlines ol 
>                        ON oh.theorder = ol.theorder
>        WHERE oh.account=' MILN1' 
>          AND oh.delivery=1 
>          AND oh.thedate='2002-06-01' 
>          AND oh.ordertype='O'
>        ORDER BY ol.line ;
> 1. COPY v_new_orderlines to '/tmp/new_orderlines.tsv';
> 2. DROP each index from orderlines
> 3. COPY orderlines from '/tmp/new_orderlines.tsv';
> 4. CREATE each index on orderlines
> 
JohnT
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ron Johnson | 2002-05-23 07:22:49 | Re: optimising data load | 
| Previous Message | Thomas A. Lowery | 2002-05-23 05:26:57 | Re: pl/perl Documentation |