If you are running mysql on a linux box, don't forget to have root set the /proc/sys/fs/file-max to something higher than the default 4096 (16384 is a good starting point) then monitor /proc/sys/fs/file-nr to see how many file handles get used during the select/inserts