5

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.

  • 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. – dezso Feb 14 '13 at 10:30
4

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.

  • 1
    is there any script to automatically do the job ? as simple as just create a cron for it ? – Omid Kosari Feb 14 '13 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 Feb 14 '13 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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