Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Which is faster


crashwave

Recommended Posts

I am making new files for a contribution and I need to find out a simple yet evasive answer.

Which is faster

PHP file seach or Mysql

 

For example

The Configuration table lets use STORE_NAME

would it be faster If this was in a definiton file say english.php

Define ('STORE_NAME', 'store name);

 

also which one uses less/more server resources.

That is one simple example. Consider several others at similar instances.

Like if we had the entire configuration table in one configuration.php file.

 

Thanks

 

Heidi

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

For example

The Configuration table lets use STORE_NAME

would it be faster If this was in a definiton file say english.php

Define ('STORE_NAME', 'store name);

 

also which one uses less/more server resources.

That is one simple example. Consider several others at similar instances.

Like if we had the entire configuration table in one configuration.php file.

 

Thanks

 

Heidi

 

It's been done before:

 

http://www.oscommerce.com/community/contributions,1862

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

The configuration table was an example, that is not what I am working on.

I need to know wether it is better to have definitions in the tables or in the files. There are a lot of definitons I need to add, and I wanted to know wether to add them in a file or table.

But I guess the answer is on that contrib page.

So it is faster to use a page and not the database???

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Yes, php code is much faster than getting the data from the database.

 

Jack

 

At least until you get into the hundreds of thousands of rows. Then the database starts to catchup, and eventually surpass the operating system level.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Possibly, although on average I think the code would be faster. Afterall, to access the database a connection has to be made and connections can take a considerable amount of time depending on things like server load and the weather.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

If you are using the native client drivers for the dbms, the connection time should also be very small. And it would depend on the number of joins in the query, and whether or not the table(s) are indexed properly, whethe or not the dbms supports bitwise indexing, wheter or not the tempdb is seperated out on a different device than the the primary data device.

 

Other considerations would be how high the cpu utilization is, how much paging space is in use and others.

 

I'd done a small amount of testing in this area, and for high volume talbes, it was very close.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...