query totalrows + thousands of results slow in pagination function

From: Date: Tue, 20 May 2003 02:07:43 +0000
Subject: query totalrows + thousands of results slow in pagination function
Groups: php.general 
Request: Send a blank email to php-general+get-148239@lists.php.net to get a copy of this message
hi there, i have a pagination function which works ok with small resultsets but noticed a massive change in performance when i used it against thousands of results , basically there is two queries one to get the mysql_num_rows total results and the other to append a limit clause to the query , although i have found this to be slow as it is taking a bit to get the totalrows first to the tune of 15 secs , it seems to be buffering it aswell which i dont want , is there a good ideal way to improve this ? i have tried these SQL_CALC_FOUND_ROWS , count(*) , mysql_unbuffered_query with no luck , the setting on the server has cache to ON instead of demand so SQL_NO_CACHE doesnt seem to work , sorry if this maybe off topic but mysql_num_rows is slow

« previous php.general (#148239) next »