Jump to content

MySQL Query or Include variables from file - Which is Faster


Flame_N

Recommended Posts

Hi to all again,

It's pretty simple. I have a database table that rarely changes it's values. Would it be faster to insert the variables from that table into a file (and include that file into the PHP file that needs the value) or just query the database when needed?

 

I can run a script once I need to change the values and the script can write them to the file that is included in the PHP file that needs them.

 

If you don't know the answer can you tell me how I can test how much time a PHP script needs to run... can I find what time it is in a desired moment in the script in milliseconds or something?

 

Thank you all in advance

Well I would look at it from as a conformity issue. Why add more disk reads and extra code? If you are already using the same database for other things there's no sense in adding extra failure points. You could also index the information in the database and speed things up.

Archived

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

×
×
  • 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.