Page 1 of 1

maximum number of results from mysql on a page

Posted: Wed May 19, 2004 6:49 am
by muppet
Hi,

This might sound basic and confusing - here goes, is there a maximum number of records that mysql will return to a page with out significantly slowing download time. I know it depends on the structure of the rest of the page etc.

My problem is that I have a page that potentially pulls 2500 records (id_num, county, town,postcode) from a table. This is used in a double dynamic select box. I'm having to pull this off again to populate a second series of selects - ie first select is the TO destination, second select is FROM destination. With the code I've got I don't seem to be able to use the same record set twice

Ideally i want this all one one page, I could split it across several pages but only if I have to.

Some one will no doubt look at this and say - "hes avin' a laugh"

Any help would be much appreciated.

SMIFFY :?

Posted: Wed May 19, 2004 10:41 am
by dave420
If you're wanting to give the user a selection of 2500 records, it's gonna be slow however you do it :) Could you group them beforehand?

Posted: Wed May 19, 2004 10:44 am
by JayBird
Show your code!

You can use the result set twice, but you need to reest the pointer back to the begining of the results using this function http://se.php.net/manual/en/function.my ... a-seek.php

Mark

Posted: Thu May 20, 2004 9:27 am
by fastfingertips
I'm not sure but i think that you will not find a signifiant speed improvement through PHP, perhaps is better to look in a MySQL optimisation area there you will find some details like: caching some static tables etc.

Posted: Thu May 20, 2004 9:33 am
by fastfingertips
Or instead of serving them 2500 reords on a page just give him 25 and make a browse menu for the rest, in this way you will bring from database only 25 results on every select and you will have loaded only 2 variables, so 25 +2 is an improvement :D

Posted: Thu Jun 03, 2004 5:19 am
by choppsta
It looks to me like you're pulling out towns?

If so, i'd probably first have a select box with just the counties.
Then reload the page with another select box for the towns in that selected county.

or...

Have some alphabetical links (A | B | C | D | E.. etc.) which go to pages that list all the towns starting with those letters...

OR... ;)

You have a postcode field... Get the user to enter the first two digits of the postcode and then show them a list of matching towns...