Optimize Performance Using LIMIT
Let's say you are searching the database for one row. You can optimize performance by adding
1. Instead of scanning the entire database table(s), mySQL will stop scanning after it finds the first one. For example:
SELECT * FROM `users` WHERE `user` = 'jsmith' LIMIT 1
In the case of large database tables, the performance benefit can be large: in terms of time savings, and reduced load on mySQL server.