Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem: LIMIT does not limit

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

select * from dic limit 0,30

In a database with millions of records this query takes
minutes to finish when I only need the first 30 records
from the table.

It seems the LIMIT clause limits only results sent to the client.
MySQL selects ALL records matching the search criteria and
sends to the client only the records specified in the LIMIT clause.

The MySQL documentation says the LIMIT stops the search
after it finds the specified numer of records.

A bug in MySQL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top