loading data, creating indexes, clustering, vacuum... - Mailing list pgsql-general

From Angva
Subject loading data, creating indexes, clustering, vacuum...
Date
Msg-id 1165509486.510735.194760@79g2000cws.googlegroups.com
Whole thread Raw
Responses Re: loading data, creating indexes, clustering, vacuum...  (Alan Hodgson <ahodgson@simkin.ca>)
pg_dump: a way to not dump indexes and other objects, or a way to not create them on restore, feature request?  (Glen Parker <glenebob@nwlink.com>)
Marking indexes out of date (WAS: loading data, creating indexes, clustering, vacuum) feature request?  (Glen Parker <glenebob@nwlink.com>)
List pgsql-general
Hi everyone,

Looking for a small bit of advice...

I have a script that updates several tables with large amounts of data.
Before running the updates, it drops all indexes for optimal
performance. When the updates have finished, I run the following
procedure:

recreate the indexes
cluster the tables
vacuum full analyze on the tables

I was hoping an expert could comment on the optimal way to order these
three commands. For instance I have a hunch that creating the indexes
first (as I do now) could slow down the clustering - perhaps the row
locations in the indexes all have to be updated as the cluster command
shifts their locations? And perhaps vacuuming should be done before
clustering so that dead tuples aren't "in the way"?

Of course I could just test every combination until I get it right, but
I'd like to have a good understanding as well.

Any insight would be much appreciated.

Thank you,
Mark


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: The relative stability of different procedural
Next
From: "Lenorovitz, Joel"
Date:
Subject: Help with Update Rule on View - 2nd Attempt