RE: [PHP-DB] RE: LIMIT and get_num_rows

2002-01-14 Thread matt stewart

yep, it returns 20.

-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 14:17
To: matt stewart; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] RE: LIMIT and get_num_rows


Have you (original post-er) tested performing a SELECT ... LIMIT 0, 20 and
then calling mysql_num_rows()?
Does it return 20 (the LIMIT) or the number of rows SELECT-ed before/without
regard to the limit?

=dn

- Original Message - 
From: "matt stewart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 14 January 2002 14:05
Subject: RE: [PHP-DB] RE: LIMIT and get_num_rows


> you've assumed correctly - so it's definitely faster to do the two
queries?
> okey dokey, then that's the method i shall use.
> thanks to everyone who's added their thoughts!
> 
> -Original Message-
> From: Peter Westergaard [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2002 14:01
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] RE: LIMIT and get_num_rows
> 
> 
> 
> >but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
> >LIKE "%sport%"
> >followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT
> 0,20
> >
> >it's still using nearly as much processing time as just returning all the
> >designs and just using a get_num_rows and then only using the first 20?
> 
> I absolutely think it will not.
> 
> After all, the table record count should be able to reference the index, 
> (you are running this query against an indexed 'Keywords' column yes?), 
> while assembling the table of returned data will take quite a bit more 
> memory, which is what you're really trying to cut down, I think.
> 
> Cheers,
> -Peter
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] RE: LIMIT and get_num_rows

2002-01-14 Thread DL Neil

Have you (original post-er) tested performing a SELECT ... LIMIT 0, 20 and then 
calling mysql_num_rows()?
Does it return 20 (the LIMIT) or the number of rows SELECT-ed before/without regard to 
the limit?

=dn

- Original Message - 
From: "matt stewart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 14 January 2002 14:05
Subject: RE: [PHP-DB] RE: LIMIT and get_num_rows


> you've assumed correctly - so it's definitely faster to do the two queries?
> okey dokey, then that's the method i shall use.
> thanks to everyone who's added their thoughts!
> 
> -Original Message-
> From: Peter Westergaard [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2002 14:01
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] RE: LIMIT and get_num_rows
> 
> 
> 
> >but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
> >LIKE "%sport%"
> >followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT
> 0,20
> >
> >it's still using nearly as much processing time as just returning all the
> >designs and just using a get_num_rows and then only using the first 20?
> 
> I absolutely think it will not.
> 
> After all, the table record count should be able to reference the index, 
> (you are running this query against an indexed 'Keywords' column yes?), 
> while assembling the table of returned data will take quite a bit more 
> memory, which is what you're really trying to cut down, I think.
> 
> Cheers,
> -Peter
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] RE: LIMIT and get_num_rows

2002-01-14 Thread matt stewart

you've assumed correctly - so it's definitely faster to do the two queries?
okey dokey, then that's the method i shall use.
thanks to everyone who's added their thoughts!

-Original Message-
From: Peter Westergaard [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 14:01
To: [EMAIL PROTECTED]
Subject: [PHP-DB] RE: LIMIT and get_num_rows



>but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
>LIKE "%sport%"
>followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT
0,20
>
>it's still using nearly as much processing time as just returning all the
>designs and just using a get_num_rows and then only using the first 20?

I absolutely think it will not.

After all, the table record count should be able to reference the index, 
(you are running this query against an indexed 'Keywords' column yes?), 
while assembling the table of returned data will take quite a bit more 
memory, which is what you're really trying to cut down, I think.

Cheers,
-Peter


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]