Use the LIMIT clause when you know how many rows you expect to return, for example, if you are looking for a record with a known identification field that is unique, limit your selection to 1, so mysql will stop searching after it finds the first record. The same goes for updates and deletions.
SELECT * FROM `yourTable` WHERE `idField` = 123 LIMIT 1
source
share