Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2009
    Posts
    21

    Unanswered: LIMIT improves query performance?

    Hi

    Does anyone knows if the LIMIT inside a select query improves queries performance?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    depends on the query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2009
    Posts
    21
    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?

  4. #4
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •