When possible, use the LIMIT statement to specify the number of results to return. This helps minimize the amount of CPU and RAM used to find the relevant records.
The improvement in performance will be even greater if the records contain many large fields.
When selecting, if you only want to display the first 25 records of a table containing people’s first and last names, replace the following:
SELECT first_name, last_name FROM people
with:
SELECT first_name, last_name FROM people LIMIT 0,25