Re: help required in design of database - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: help required in design of database
Date
Msg-id 20060210210319.GA18407@uio.no
Whole thread Raw
In response to help required in design of database  (david drummard <vijayspam@gmail.com>)
List pgsql-performance
On Fri, Feb 10, 2006 at 12:20:34PM -0800, david drummard wrote:
> 1) create a new table every time a new feed file comes in. Create table with
> indexes. Use the copy command to dump the data into the table.
> 2) rename the current table to some old table name and rename the new table
> to current table name so that applications can access them directly.

That sounds like a working plan.

> Should i create indexes before or after import ? I need to do this in
> shortest period of time so that the data is always uptodate. Note that
> incremental updates are not possible since almost every row will be changed
> in the new file.

You should create indexes after the import. Remember to pump up your memory
settings (maintenance_work_mem) if you want this to be quick.

/* Steinar */
--
Homepage: http://www.sesse.net/

pgsql-performance by date:

Previous
From: david drummard
Date:
Subject: help required in design of database
Next
From: "Tim Jones"
Date:
Subject: joining two tables slow due to sequential scan