From: Stephen Frost <sfrost@snowman.net>
To: david drummard <vijayspam@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: performance question related to pgsql
Date: Fri, 10 Feb 2006 15:46:53 -0500
Message-ID: <20060210204653.GH4474@ns.snowman.net> (raw)
In-Reply-To: <9c89e2490602101241i6a182491l53478521f15f7f8d@mail.gmail.com>
References: <9c89e2490602101241i6a182491l53478521f15f7f8d@mail.gmail.com>
* 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
Attachments:
signature.asc (application/pgp-signature, 188B) download
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-admin@postgresql.org
Cc: sfrost@snowman.net, vijayspam@gmail.com
Subject: Re: performance question related to pgsql
In-Reply-To: <20060210204653.GH4474@ns.snowman.net>
References: <9c89e2490602101241i6a182491l53478521f15f7f8d@mail.gmail.com> <20060210204653.GH4474@ns.snowman.net>
* 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