Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]> > on a related note... how does BENCHMARK() work? i don't understand their > explanation. the reason i ask is because i'd like to test our the > efficiency of what you are suggesting compared to what i am currently > doing. > > SELECT BENCHMARK(500, 'SEL

Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
From: "Chris W. Parker" <[EMAIL PROTECTED]> > do you know if that's any faster than doing a "SELECT COUNT(*) FROM > table WHERE ..." ? I did a couple (unscientific) tests and there doesn't seem to be much of a difference. I'd use the COUNT(*) method just because it's more portable, though. ---Jo

RE: [PHP] paging methodology

2004-05-05 Thread Brad Pauly
On Wed, 2004-05-05 at 12:23, Chris wrote: > It's certainly faster than "SELECT COUNT(*) FROM sometable WHERE . . ."; > > It might not be faster than "SELECT COUNT(*) FROM sometable", as that is > designed to run very quickly. I believe it will also depend on the type of table you are using. "SELE

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
Chris on Wednesday, May 05, 2004 11:24 AM said: > The documentation for the FOUND_ROWS() function is here: > http://dev.mysql.com/doc/mysql/en/Information_functions.html ahh... i see. so it essentially allows you to execute one query while achieving the same two que

RE: [PHP] paging methodology

2004-05-05 Thread Chris
nformation_functions.html Chris -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 11:07 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] paging methodology Chris <mailto:[EMAIL PROTECTED]> on Wednesday, May 05, 2004 10:56 AM said: >

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
Chris on Wednesday, May 05, 2004 10:56 AM said: > If you're using MySQL 4+ you could use the SQL_CALC_FOUND_ROWS flag > in the select statement. > > It causes the query to count the number of rows it *would have* > returned if there had been no limit clause. do you

RE: [PHP] paging methodology

2004-05-05 Thread Chris
found rows. Chris -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:33 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] paging methodology John W. Holmes <mailto:[EMAIL PROTECTED]> on Wednesday, May 05, 2004 7:32 AM said: > Perso

RE: [PHP] paging methodology

2004-05-05 Thread Chris W. Parker
John W. Holmes on Wednesday, May 05, 2004 7:32 AM said: > Personal preference here, I guess, but I don't care for searches that > don't tell you how many records were matched (or how many pages > you'll have). I think the additional query is well worth it. The > numb

Re: [PHP] paging methodology

2004-05-05 Thread John W. Holmes
- Original Message - From: "Paul Chvostek" <[EMAIL PROTECTED]> > On Tue, May 04, 2004 at 02:37:50PM -0700, Chris W. Parker wrote: > > well that just meant that after the initial count of records is found it > > will be retrieved from the querystring instead of through a select > > stateme

Re: [PHP] paging methodology

2004-05-05 Thread Brian Muldown
Chris W. Parker wrote: ok. this is what i was already doing in my previous app but i was just looking to see if it could be streamlined some how. You could perform the full (without LIMIT) query once, Cache the results array (using PEAR Cache) and move back-and-forth through this Cached array. D

Re: [PHP] paging methodology

2004-05-04 Thread Paul Chvostek
On Tue, May 04, 2004 at 02:37:50PM -0700, Chris W. Parker wrote: > > > I don't follow what "$_GET record count from initial query performed > > above;" is for, but that's the basic methodology. > > well that just meant that after the initial count of records is found it > will be retrieved from t

RE: [PHP] paging methodology

2004-05-04 Thread Chris W. Parker
John W. Holmes on Tuesday, May 04, 2004 1:30 PM said: > I don't follow what "$_GET record count from initial query performed > above;" is for, but that's the basic methodology. well that just meant that after the initial count of records is found it will be retrieve