in reply to Optimizing a MySQL Query

When speaking about placeholders, you may want to look at Tricks with DBI. I liked it and learned a lot. Also, you may want to look at discussion about Learning CGI & DBI well - if this is what you want to learn well... ;-)

And yes, INDEX is a way how to increase speed of data access in database - for the price: you have some speed penalty to maintan it when updating indexed fields. This is interesting, but OT here.

To make errors is human. But to make million errors per second, you need a computer.