7

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
  • 2
    I would not expect any problem stopping a 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 with CREATE INDEX CONCURRENTLY wouldn't block the normal operation of your system. Commented Feb 14, 2013 at 10:30

1 Answer 1

6

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.

2
  • 1
    is there any script to automatically do the job ? as simple as just create a cron for it ? Commented Feb 14, 2013 at 10:46
  • 1
    Not 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.
    – user1593
    Commented Feb 14, 2013 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.