I am running a REINDEX
but it takes long time and still working. The application using the DB is not responding right now. Is there a safe way to stop it and do it another time?
PostgreSQL version is 8.4.
1 Answer
Yes, it's safe. Might take a while, though.
In future you might want to use "CREATE INDEX CONCURRENTLY", like dezso suggested, but first create new index, and then drop old one.
-
1is there any script to automatically do the job ? as simple as just create a cron for it ? Commented Feb 14, 2013 at 10:46
-
1Not that I know of, but since it's just two commands, you can write the commands in "recreate.sql" file, and now you have a script.– user1593Commented Feb 14, 2013 at 10:49
REINDEX
. Once it started, the index would be unusable until REINDEX successfully would finish. But I'm concerned more with why do you need reindexing? Anyhow, dropping the index and building it withCREATE INDEX CONCURRENTLY
wouldn't block the normal operation of your system.