nice -n 19 lowers the priority of a job, but it still gets a small share of CPU when the machine is busy. The idle scheduling policy goes one step further.
chrt -i 0 ./reindex.sh
-i selects SCHED_IDLE, and the 0 is the priority, which must be 0 for this policy. The sched(7) man page describes it as meant for running jobs at extremely low priority, lower even than nice 19. On a busy box, the job waits until other work is done; on a quiet box it still runs at full speed. That makes it a good fit for search indexing, thumbnail generation or checksum runs that may take as long as they need.
To check or change a running process:
chrt -p 1234
chrt -i -p 0 1234
There is also -b for SCHED_BATCH, which tells the scheduler the job is not interactive and may be woken up a bit less eagerly. It is milder than idle.
This only covers CPU time. A job that mostly reads and writes the disk can still slow everything down, so combine it with ionice -c3 when disk load is the real problem.
There is a trap with idle jobs that hold locks. If such a job takes a lock that a normal process needs and then never gets CPU time because the box is busy, the normal process waits too. I would not use it for jobs that lock a shared database or file that other programs need.
Further reading: chrt(1) manual page, sched(7) manual page