pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jackson, DeJuan <djackson@cpsgroup.com>
To: Barracuda <cuda_fx@yahoo.com>
To: pgsql-sql@postgreSQL.org
Subject: RE: [SQL] Updating database
Date: Thu, 5 Nov 1998 12:43:31 -0600
Message-ID: <F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail> (raw)

> 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
> 



view thread (4+ messages)

Message-ID: <F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail>
Permalink:  ../F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail/
Also on:    postgresql.org/message-id/F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: djackson@cpsgroup.com, cuda_fx@yahoo.com
  Subject: Re: [SQL] Updating database
  In-Reply-To: <F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail>
  References: <F10BB1FAF801D111829B0060971D839F4D72F0@cpsmail>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox