In fact, if you want to limit the amount of resources your script eats, you'd want to use nice, but considering that you probably want to SPEED UP the script, you have a few options:
migrate the entire search mechanism to the database
unbuffer script output through server, so client gets something while waiting for next results (gives illusion of speed)
use ReiserFS for that FS speed boost
use smart cacheing, perhaps the easiest option to implement
use the unbuffering I mentioned above in congruence with Bone::Easy to insult the user away from waiting for further results