Jump to content

database design


chaiwei

Recommended Posts

Hi,

 

I got a page which allow candidate to type in their previous working experience,

I let user to choose the start date and end date and then system will automatically

calculate the total experience in years and months.

 

So when the I need to save the data, should I save the generated total experience?

 

Some of my friends said I should not store the total experience in database, due to the total experience is based on the start date and end date.

 

First I was think about if we don't store the total exp, when the time come to search, Let say I want to search for a candidate which has total experience equals to 10 years,

I have to use mysql to do the calculation, I was wonder whether it will slow down on the select query?

 

if I got millions row in the database? will it affect the performance?

 

 

Link to comment
Share on other sites

Saving the total exp is perfectly valid thing to do..

If you want to allow the users to change the start and end date in the future you can also store them in the table..

So your essentially storing all values..

 

Dont quote me on this.. I dont think that MySQL will slow down too much with the calculation on the fly. I mean it has functions built into it that will suit this to a tee.. (DATEDIFF)

 

Its really upto the individual.. and if you do notice a slow down in the future you can always revise..

Link to comment
Share on other sites

Hi,

 

I got a page which allow candidate to type in their previous working experience,

I let user to choose the start date and end date and then system will automatically

calculate the total experience in years and months.

 

So when the I need to save the data, should I save the generated total experience?

 

Some of my friends said I should not store the total experience in database, due to the total experience is based on the start date and end date.

 

First I was think about if we don't store the total exp, when the time come to search, Let say I want to search for a candidate which has total experience equals to 10 years,

I have to use mysql to do the calculation, I was wonder whether it will slow down on the select query?

 

if I got millions row in the database? will it affect the performance?

 

 

if u are using so long database like millions of line record in your database it will slow the query execution but not as much as it will affect your performance while u are doing mysql calculation on the table to get the desired result.

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.