![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| The Following User Says Thank You to sbenj69 For This Useful Post: | ||
jmurrayhead (May 27th, 2008) | ||
| Sponsored Links |
| ||||
| Hi, ben, this is califdon (aka don94403!) ![]() Of course I agree with you completely, but I wanted to add my slant on it: the strongest reason why storing calculated values is bad is that it violates the 3rd Normal Form rule of normalization, which states that no non-key attribute should be dependent on any other non-key attribute. You will find some database practitioners who will argue that this is carrying things too far. But whose opinion means more to you, some unknown database developer, or Dr. Ted Codd and Chris Date, who developed relational database theory and wrote the primary textbook that is still used around the world, 8 editions and 40 years later? Your explanation is a good down-to-earth explanation and is probably more useful to most beginners, but I just thought I'd go on the record with the formal explanation. |
| The Following User Says Thank You to don94403 For This Useful Post: | ||
sbenj69 (May 27th, 2008) | ||
| ||||
| I agree completely Don. I was kinda counting on you to give the more formal explanation . I merely wanted to make simple db to show how it could fail those who try to store calculated values I tried to rep ya, but it says I need to spread it around first ![]() |
| ||||
| I just want to add that there are exceptions to every rule. When it comes down to performance of a system, sometimes you have to store a calculated value in your table structure. Take this forum, for instance. Thread, post, and view counts (among a few others) are all pre-calculated and stored in the table. Why? Take into consideration a forum that has thousands of posts and hundreds to thousands of visitors a day. It would be pretty demanding on the database, be it Access, MySQL, MS SQL or any other, to have to calculate these values every time a user browses a page. Just be sure you adequately prepare for miscalculations. This forum has a few functions that can be run to repair these counters so that they are accurate. I know this could be argued to death, but I will say you can do things correctly and have performance issues or the other way and have miscalculations.
__________________ jmurrayhead Did I help you out? Make me popular by clicking the icon!If you found a post helpful, please click the button in the lower right-hand corner of the post.Powered by ASP.Net |
| ||||
| I completely agree, jmh, when it comes to experienced designers who understand what they are doing and why. I usually don't say that up-front, because the people who usually are reading about normalizing a database haven't yet learned enough to make good decisions about when to denormalize one. |
| ||||
| Quote:
![]() |
| ||||
| Yup, just to add another voice to the 'exceptions' rule. They are call exceptions becasue, well, they are 'excpetions!'. Follow the rule of normalization unless you have a VERY GOOD REASON for making the exception.
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with Updating field | Rebelle | Microsoft Access | 5 | April 1st, 2008 06:45 PM |
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |