Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's best for performance????

Status
Not open for further replies.

jotap

Technical User
Apr 8, 2005
12
PT
I'm developing a webstore application for e-commerce(or trying to :p ). I'm wondering about the best way to get some values from my database. I have Categories, Families and SubFamilies.

Now each time i load a page, depending on the page level, the server has to load/unload around 5 recordsets. what if i use arrays for the Categories, Families and SubFamilies.
For example: on application_onstart get the values from the database and store them in the arrays.
Do you think it would be faster? Would or could it be too "heavy" for the server?

What do you thing?
 
That depends on a lot of things...

- The size of cache/array
- How much RAM wich is available on the server

Besides, you will have to reload cache if something do change in the table, so you have to be sure that this data is pretty static, or you haven't gained anything.

Maybe it's faster if you cache, but unless the tables are gigantic, or there are some heavy math in database to give you the result you will not notice it. I think we're talking ns here...

I did set up something similar a couple of years ago with php/mysql. In that database it's over 11000 products. A query on this database to retrieve all products takes less than 0.004 seconds. If you index the tables correct, you will not gain much on cache I think.

The best advice I can give you is to start to make a couple of queries against the database and see if you're happy with the time it use to give you the result. If you are happy, you should leave the cache idea. If you ain't, try to tune the tables correct. If you're still not happy, then you should consider cache.
 
Another factor when tuning performance... Is your database on the same box as your web server or do you have to go across the network. What is the response time for the network? Is the database server busy with other things, etc...

I don't think there is a single rule that will always fit for every configuration.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top