Re: performance question related to pgsql - Mailing list pgsql-admin

From Stephen Frost
Subject Re: performance question related to pgsql
Date
Msg-id 20060210204653.GH4474@ns.snowman.net
Whole thread Raw
In response to performance question related to pgsql  (david drummard <vijayspam@gmail.com>)
Responses Re: performance question related to pgsql  (david drummard <vijayspam@gmail.com>)
List pgsql-admin
* david drummard (vijayspam@gmail.com) wrote:
> My question is what is the best way to do step (1) so that after the copy is
> done, the table is fully indexed  and properly balanced and optimized for
> query.
> 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.

Create indexes after import, definitely.  analyze after indexes have
been created.  You don't need to vacuum if you're creating a whole new
table each time.  Remember that if you need to adjust analyze parameters
for some reason that you'll need to do that on every table creation as
well.  Using COPY is a good approach.  Not doing incremental updates
when most of the rows are changing also makes sense.

    Thanks,

        Stephen

Attachment

pgsql-admin by date:

Previous
From: david drummard
Date:
Subject: performance question related to pgsql
Next
From: Chris Browne
Date:
Subject: Re: Is the database being VACUUMed?