I'm trying to find out if using "limit 1" would work faster while executing a "select" query on MySQL database with milions of records, like:
SELECT * FROM users where id = 99999;
SELECT * FROM users where id = 99999 LIMIT 1; /* Is it faster? */
I made some tests executing some queries with and without the LIMIT, but the difference between them are really small (using LIMIt has some better speed tho), but I'm not sure if there is any difference between using the "WHERE" in a not indexed column and in an indexed column, if it would have some performance problem or not.
Should I use the "LIMIT 1" in all queries that I want to return only one result even knowing that the "WHERE id = 99999" will return only one row?