chaiwei Posted December 14, 2009 Share Posted December 14, 2009 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 https://forums.phpfreaks.com/topic/185071-database-design/ Share on other sites More sharing options...
Buddski Posted December 14, 2009 Share Posted December 14, 2009 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 https://forums.phpfreaks.com/topic/185071-database-design/#findComment-976893 Share on other sites More sharing options...
rajeevbharti Posted December 14, 2009 Share Posted December 14, 2009 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 https://forums.phpfreaks.com/topic/185071-database-design/#findComment-977013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.