RE: [SQL] Updating database

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Barracuda <cuda_fx(at)yahoo(dot)com>, pgsql-sql(at)postgreSQL(dot)org
Subject: RE: [SQL] Updating database
Date: 1998-11-05 18:43:31
Message-ID: F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Please help:)
>
> We have a knowledge base that needs updated every night from a large
> text file. Currently a script deletes everything from a table and
> adds the new data. This procedure seems to slowly cause the database
> to loose performance daily. It also leaves our database useless for
> several hours starting at midnight. I thought about using 2
> databases, updating one while using the other, then swapping them
> every day. I also thought about having one db.out, then the other in.
>
> Is there a better way to do this?
>
> Thanks in advance.
>
> Charles Day
>
Why don't you just use another table to COPY the data into. Then at the
end of the copy either
LOCK, DELETE FROM, INSERT INTO, then VACUUM ANALYZE
or
DROP, ALTER to rename the copy, recreate INDEXES, then VACUUM ANALYZE

I'd do a time test to see which uses the least amount of time.
Enjoy,
-DEJ

> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>

Browse pgsql-sql by date

  From Date Subject
Next Message Daniela Mariano 1998-11-06 19:16:03 Entity-Relationship Diagram
Previous Message G.Elangovan 1998-11-05 16:54:20 Re: Rules (was: Re: [SQL] How can I optimize...)