MySQL Forums
Forum List  »  Newbie

Re: SQL_CALC_FOUND_ROWS slow?
Posted by: bth505
Date: July 14, 2005 06:57PM

Sounds like an un-optimized where query, the joins are most likely not the problem. When using COUNT or SQL_CALC_FOUND_ROWS with a WHERE the mysql server has to process every row. When using a LIMIT the query halts as soon as the max-limit is reached. Depending on the size of the result set this may only process a marginal ammount of the database. If you just need a matches count and a smaller result SQL_CALC_FOUND_ROWS is probably perfect but you must have friendly indexes and WHERE clauses as it reads the entire table. Read more on 'How Mysql optimizes WHERE and ORDER'.

Options: ReplyQuote


Subject
Written By
Posted
Re: SQL_CALC_FOUND_ROWS slow?
July 14, 2005 06:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.