954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Does database influence page load?

Hello,

I want to know if I am doing a list of students, which are executed from database (mysql),

does the number of data influence in the speed of the page load?

if yes:
What to do ?

And for how much data should I start to think for a solution ?

Thank you

amirbwb
Light Poster
25 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

The actual number of records being read from the database shouldn't have much impact unless it is really large. If you are displaying a very long list on a web page that will have some impact. The solution to that is to use "pagination" to display a fixed number at a time with navigation button to move forward or backward. There are JQuery modules and sample PHP code available if you do a search on "pagination".

chrishea
Nearly a Posting Virtuoso
1,429 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
 

Together with chrishea suggestions you can:
1. cache queries on mysql
2. run tables in memory engine (a copy of the original)
3. cache result to a file or better cache php
4. cache results to memory through memcached

For reference:
1. http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
2. http://dev.mysql.com/doc/refman/5.5/en/memory-storage-engine.html
3. http://php.net/manual/en/book.apc.php
4. http://php.net/manual/en/book.memcached.php

bye :)

cereal
Master Poster
709 posts since Aug 2007
Reputation Points: 214
Solved Threads: 120
 

I am using the pagination, but the question is even if i use pagination,
in the code there will be

mysql_query('select * from TABLE')

and

mysql_query('select * from TABLE LIMIT $a,$b')

because first I should count all data and than do a math trick !!

mmm ...

Thank you anyway =)

amirbwb
Light Poster
25 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

@cereal I didn't get my answer in these pagse ... sorry
But thank you anyway

amirbwb
Light Poster
25 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: