Re: Question on REINDEX - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Question on REINDEX
Date
Msg-id 200504181233.56784.josh@agliodbs.com
Whole thread Raw
In response to Question on REINDEX  (Bill Chandler <billybobc1210@yahoo.com>)
Responses Re: Question on REINDEX
List pgsql-performance
Bill,

> 1) When is it necessary to run REINDEX or drop/create
> an index?  All I could really find in the docs is:

If you need to VACUUM FULL, you need to REINDEX as well.  For example, if you
drop millions of rows from a table.

> 2) If reindexing is necessary, how can this be done in
> a non-obtrusive way in a production environment.  Our
> database is being updated constantly.  REINDEX locks
> client apps out while in progress.  Same with "CREATE
> INDEX" when we drop/create.  The table can have over
> 10 million row.  Recreating the indexes seems to take
> hours.  This is too long to lock the client apps out.
> Is there any other solution?

Better to up your max_fsm_pages and do regular VACUUMs regularly and
frequently so that you don't have to REINDEX at all.


--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-performance by date:

Previous
From: Bill Chandler
Date:
Subject: Question on vacuumdb
Next
From: Alex Turner
Date:
Subject: Re: How to improve db performance with $7K?