Jump to content

MySQL Query or Include variables from file - Which is Faster


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.

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.