Jump to content

Difference in speed with multiple pages of results vs 1 page of results


snrecords

Recommended Posts

Hi all!  Again I'm new to php and mysql ...

 

I have a site that retrieves data from the mysql database where query results shows everything on one page.  Since there are nearly 40+ rows of results ... it takes forever to load the entire page.

 

Now in comparison, I have a different query on my site that was pre-built with the software package I bought.  This query shows over 300 results (almost instantaneously) because the results are divided onto multiple pages (just like how search engines do it - except this query shows 20 rows instead of 10).

 

My question is ... why does a query with results on multiple pages show up so much faster than the page with all the results on one page?  Does this process work similarly to how music or video is streamed?

 

And lastly, if I change all the queries on my site to show up on multiple pages ... will they all process results equally fast or are there other factors involved?

 

I know this is a lot of questions ... but any help is appreciated.

 

Thanks in advance.

Link to comment
Share on other sites

your referring to pagination and it depends on the content of your fields and what each type of field is; on how fast each page will load the contents from database. this is not like streaming video/music; this is a php script that you set up to only allow specific rows from your database to be displayed on each individually paginized page. pagination usually occurs when the php script is queried with a string sent in by a $_GET, $_POST, $_SESSION, or $_COOKIE variable. this is most commonly done with the $_GET global variable.

 

do a search on this forum/site or google for "PHP Pagination" and you will be able to see an example of how this works.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.