If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > LIMIT improves query performance?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-09, 10:54
sakis sakis is offline
Registered User
 
Join Date: Nov 2009
Posts: 19
LIMIT improves query performance?

Hi

Does anyone knows if the LIMIT inside a select query improves queries performance?
Reply With Quote
  #2 (permalink)  
Old 11-19-09, 10:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
depends on the query
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-19-09, 11:44
sakis sakis is offline
Registered User
 
Join Date: Nov 2009
Posts: 19
it is a select query that refers to large tables that refers to "products

The query is searching for products with certain criteria. (price, category,manufacturer).

Could you be more specific on what it depends?
Reply With Quote
  #4 (permalink)  
Old 11-19-09, 13:19
sstory sstory is offline
Registered User
 
Join Date: Nov 2009
Posts: 7
It would have to

It would have to improve server performance and query performance. Processing 100 records instead of 100,000 by using limit is definitely going to be a performance gain.

So I think it depends on the number of records you expect to get from your query. Of course if you query for record where ID=1 then LIMIT is superfluous.
Reply With Quote
Reply

Tags
limit, query performance

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On