Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
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
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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