Skip site navigation (1) Skip section navigation (2)

Re: help required in design of database

From: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: help required in design of database
Date: 2006-02-10 21:03:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 */

In response to

pgsql-performance by date

Next:From: Tim JonesDate: 2006-02-10 22:06:35
Subject: joining two tables slow due to sequential scan
Previous:From: david drummardDate: 2006-02-10 20:20:34
Subject: help required in design of database

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group