If I want to do a check a name, I want to see how many rows/name exists in the \"username\" column under users table. Lets say thousands ... hundred of thousands, should I u
COUNT(name) or COUNT(*) will be somewhat faster because they do not need to return much data. (see Andrew Shepherd's reply on the semantic difference between these two forms of COUNT, as well as COUNT() ). The focus being to "check a name", these differences matter little with the following trick: Instead than count you can also use
SELECT username FROM users where username = 'name' LIMIT 1;
Which will have the effect of checking (the existence) of the name, but returning as soon at one is found.