MySQL Forums :: Database Design & Data Modelling :: Alternative to FOUND_ROWS()


Advanced Search

Alternative to FOUND_ROWS()
Posted by: jun kazawa ()
Date: February 08, 2009 01:07PM

FOUND_ROWS is convenient when you have to get the count of all rows from a SELECT SQL_CALC_FOUND_ROWS that contains a LIMIT clause.

However we need the count(*) of a query from a huge table where we want the count to be limited to a given number (e.g. 1000). It is almost the opposite of FOUND_ROWS().

We want actually to take advantage of the indexes and the LIMIT algorithm that reduce the number of rows examined, without returning the actual rows - just the count. The count would be actually and virtually MIN(Limit_given, count(*))

Is it possible to get such a limited count(*)?

Options: ReplyQuote


Subject Written By Posted
Alternative to FOUND_ROWS() jun kazawa 02/08/2009 01:07PM
Re: Alternative to FOUND_ROWS() Rick James 02/10/2009 12:08AM
Re: Alternative to FOUND_ROWS() jun kazawa 02/11/2009 10:21AM
Re: Alternative to FOUND_ROWS() jun kazawa 02/14/2009 01:15PM


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.