Jump to content

Why does the database "slow down"?


mrherman

Recommended Posts

Hello, everyone --

 

I'm wondering why this is happening...

 

I have a MySQL table of 1200 rows of students, in grades 9-12.  They took a test, with differentiated questions for each grade level.

 

Only one table is used, no joins, real simple.

 

My PHP scoring program works ok.  With one school of 300 test takers, the program requires about 1.5 minutes to score.

 

When I add in 3 additional schools, it doesn't take 4 x 1.5 minutes to score -- it takes about 30 minutes!

 

No school is "different" from another school.  As it scores, it does the first several hundred rows quickly.  But then it starts to slow down and then crawls, so that by the end of the scoring routine, it is scoring only 1 record per 2 - 4 seconds, it seems.

 

Just looking for some insight on what is happening.  Is it a memory-usage issue (computer has 6GB, running Win7).

 

Thanks!

Link to comment
Share on other sites

My PHP scoring program works ok.  With one school of 300 test takers, the program requires about 1.5 minutes to score.

 

That's not working ok. It should take at most a few seconds to a few 10's of seconds.

 

It sounds like you have php code retrieving and looping through all the rows from one or more tables, with queries being executed inside of loops... inside of loops. You also probably have memory management and table indexing issues.

 

It would take seeing the code responsible for the symptoms, an example of the data being processed, a statement of how much total data is being processed, and the definition of the tables involved to directly help.

 

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.