From: Austin Ziegler Date: 2002-12-18T12:01:13+09:00 Subject: Re: [OT] RE: help -- persuade my boss to adopt ruby On Wed, 18 Dec 2002 10:28:25 +0900, Shashank Date wrote: > "Austin Ziegler" wrote in message >> There are times when one should denormalize as well, but that's >> as much an art as anything else. > Now that you have mentioned this, I would urge you to read some > very enlightening articles on www.dbdebunk.com. > > Search the word "denormalize" on the site's search engine, and you > will get a wealth of material. DBDebunk is a good thing. Denormalization is definitely an art -- and something that should be approached with much trepidation (if not abject fear). I haven't really found any times when it made a lot of sense -- but I have had to do it because of PHBs. I like what Fabian and Date have to say on DBDebunk, but they are a bit abrasive which I find quite ... unhelpful to their cause. I'm fighting a bit of idiotic denormalization at this point (unnecessary and premature aggregation of data, which is making extension of the query to support two new fields for aggregation nearly impossible). The simple rule is that one shouldn't store values calculated from other columns or tables. There are, of course, times when storing of calculated values is necessary -- but they are specific and limited, and should be 100% repeatable every time. In specific, I'm thinking of billing software. A good billing system will collect the on-line data, perform billing in a *separate database and/or schema*, and after the data has been calculated, then you insert *billing records*, which may be calculated from the original data, but have now acquired more information that was not part of the original data (e.g., the billing date and a few other items like that). In this case, the cost of the duplicated data is a known cost -- because the value isn't necessarily in the duplication, but in the data added. (And even *this* can be normalized significantly.) -austin -- Austin Ziegler, austin@halostatue.ca on 2002.12.17 at 20.40.37