Linux

Letting locate to index paths with a lot of files can be painful depending on the system it is running.
To prevent it edit /etc/updatedb.conf
and add the paths to prune like this:
PRUNEPATHS="/tmp /var/spool /media /this/path/will/not/be/indexed"