Please wait while we load your page...


Webmaster Tutorials

Webmaster Tutorials

Optimize Performance Using LIMIT
Let's say you are searching the database for one row. You can optimize performance by adding LIMIT 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.

Last Revised: 2015-10-01 21:34:46

Live Chat Not Available