AW: [PHP-DB] Performance in MySQL Result Question

2003-03-18 Thread Jan Bro
thx folks, 
I pretty much thought version 1 to be the best. 
I' wouldn't have known how to carry the result to other pages anyway.
Jan
 
 
 Hi,
 I've got a page with lot's of visitors every day and I sure hope to 
 get more, so I'm already thinking of performance. This is what I've
 got. 
 
 Users select one or more things out of a couple drop down menus,
 no big deal. Their selection is than shown, with a limitation of
 20 results on the page. 
 
 Now comes my question, what is better speaking of performance: 
 When users go on to the next page, is it better to 
 provide the select statement again with a different integer for
 the limit? 
 
 Or is better to do a full select without a limitation on first page.
 But than I don't know how to provide the result set for the 
 next, next, ... page?
 
 What would be your choice? I'm open to suggestions, maybe somebody has
 a totally different idea. The limitation of 20 is a wish of my customer.
 I think, most vistors won't stay on page one, but will click thru
 some pages further. The max. number of results shown should be around
 1000 hits.
 
 Jan
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Performance in MySQL Result Question

2003-03-17 Thread Brent Baisley
I know what you are trying to get at. A full select and a select with 
limit have the same query speed, but the full select has to transfer all 
of the selected data, where as a limit only transfers the number of 
records specified. The more records that match a search, the faster your 
limit select will be in relation to a full select.

As for improving performance, you would like to avoid re-executing a 
complex query just to get the next set of records. If you are using 
MySQL 4 with query caching enabled you don't have to worry. MySQL will 
be smart enough to cache the query result and won't rerun the exact same 
query on the database if no data has changed.

On Saturday, March 15, 2003, at 03:57 AM, Jan Bro wrote:

Now comes my question, what is better speaking of performance:
When users go on to the next page, is it better to
provide the select statement again with a different integer for
the limit?
Or is better to do a full select without a limitation on first page.
But than I don't know how to provide the result set for the
next, next, ... page?
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Performance in MySQL Result Question

2003-03-15 Thread Jan Bro
Hi,
I've got a page with lot's of visitors every day and I sure hope to 
get more, so I'm already thinking of performance. This is what I've
got. 

Users select one or more things out of a couple drop down menus,
no big deal. Their selection is than shown, with a limitation of
20 results on the page. 

Now comes my question, what is better speaking of performance: 
When users go on to the next page, is it better to 
provide the select statement again with a different integer for
the limit? 

Or is better to do a full select without a limitation on first page.
But than I don't know how to provide the result set for the 
next, next, ... page?

What would be your choice? I'm open to suggestions, maybe somebody has
a totally different idea. The limitation of 20 is a wish of my customer.
I think, most vistors won't stay on page one, but will click thru
some pages further. The max. number of results shown should be around
1000 hits.

Jan


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Performance in MySQL Result Question

2003-03-15 Thread John W. Holmes
[snip]
 Now comes my question, what is better speaking of performance:
 When users go on to the next page, is it better to
 provide the select statement again with a different integer for
 the limit?
 
 Or is better to do a full select without a limitation on first page.
 But than I don't know how to provide the result set for the
 next, next, ... page?
[snip]

Use a limit, it's efficient. You can't do a full select on one page and
somehow carry the result over to another page with any kind of
efficiency.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php