Jump to content

Reducing load on MySQL


mgm_03

Recommended Posts

My application will involve potentially hundreds or thousands of companies.

 

On one webpage I want to have alphabetical links that correspond to companies whose name starts with a certain letter. When the user clicks a letter, all the companies in that letter category are returned...

 

(all hyperlinks ->) A B C D E ...X Y Z

 

It seems to me, querying the database on each click might be inefficient if the info is relatively static. Would it make better sense to do the query periodically to keep it up to date? Then store the query results in a text file which is retrieved and ouputted when the user clicks a letter.

Link to comment
Share on other sites

How much information are you going to be returning on each query? For instance, if someone clicks on the letter A, are they just going to see a list of company names beggining with A, or are they going to see the company name, a paragraph about the company, location of the company, # of employees...

 

If you are just returning a name, or something short, I wouldn\'t bother with the text file. MySQL can return queries like that very fast, even if you have several thousand companies per letter.

 

True, accessing static test files will be faster, but unless you have a ton of info per company, in my opinion, it isn\'t worth the extra effort on your part.

Link to comment
Share on other sites

Thanks for replying.

 

Just retrieving:

Company, address, city, state, area code, phone

 

I\'m thinking there probably won\'t be more than a few hundred companies whose names all start with the same letter so...probably database is the way to go.

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.