I'm trying to speed up my SELECT
queries in my web application. I have done some pretty major optimizations, like ordering the rows returned by PHP rather than MySQL itself. Now I'm just wondering, is it faster to use the SELECT
statement on columns that are a primary key?
Example, I have a table set up with the columns settingKey
and settingValue
, which I am using for my configuration. Would it be faster to grab the contents of settingValue
when settingKey
is a primary index, with a statement like this?
SELECT settingValue FROM config WHERE settingKey="MasterPassword"
I have tried Google'ing for the answer but came to no clear answer.
Thanks. :)