Re: DB_Pager

From: Date: Wed, 10 Jul 2002 15:28:32 +0000
Subject: Re: DB_Pager
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7640@lists.php.net to get a copy of this message
LIMBOURG Arnaud wrote: > > YOu're right, if you use limitQuery you're stuck. > > Tou have to do one limit query then a simple query just to get numRows(). > > So, it's not such a good idea to use limitQuery() ;)))) > > But tomas already knows, right ? ;) > Yeah, Pierre pointed that out. DB_Pager fetchs rows by number (like mysql_seek) and this is not as fast as limitQuery() and of course that consumes more resources (specially on huge amount of results). BTW, limitQuery() is supported in all backends not as fetch row by number. The real good way for doing that, is using limitQuery() and a second query that just do a "SELECT count(*)" in the first page and propagates the $numrows var with for ex sessions. In short: use the actual easy way of use when there are few ammount of results and that other way when you care on performance. Ok, I have to documment all this, many people is asking that. Tomas V.V.Cox

« previous php.pear.dev (#7640) next »