MySQL Forums
Forum List  »  Optimizer & Parser

Re: count(*) versus mysql_num_rows
Posted by: Rob Blick
Date: June 08, 2006 09:41AM

I don't understand... if you need to get the rows anyway for display, then just get the rows and use mysql_num_rows (which just counts the resultset, which you've already materialized). Why run a separate query to count the rows? But if you only need the count and you're worried about the query cache, do

SELECT SQL_NO_CACHE COUNT(*) FROM blah...

Rob

Options: ReplyQuote


Subject
Views
Written By
Posted
27496
November 21, 2005 03:54PM
7236
November 24, 2005 09:18AM
7781
June 02, 2006 04:13AM
Re: count(*) versus mysql_num_rows
5366
June 08, 2006 09:41AM


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.