4 ms·
What is the ratio of retrieving (reporting) to updating? You just may want to ask this question before you decide how far to normalize your data. Got 13 insta
by edw519 19y ago
What is the ratio of retrieving (reporting) to updating? You just may want to ask this question before you decide how far to normalize your data. Got 13 instances of the same thing? EVERY ONE of them must be updated simultaneously with EVERY update (including all the necessary locking, committing, etc.)
Calling people sissies is what sissies do. (Oops, does that make me a sissie?)
- brlewis 19y agoI agree. I think the best strategy is to start with a normalized database, and only denormalize when you measure a problem that can't be fixed by adding an index.
- Flemlord 19y agoI'm working on a project where we're in the process of storing de-normalized links for a recursive table relationship, so we can query from the top-level table directly to the bottom-level table without worrying about the messy inbetween. One of the few non-speed reasons I've ever come across where denormzalization seems jutified.
- brlewis 19y agoMight want to check Joe Celko's Trees and Hierarchies in SQL to see if there's a normalized way to do what you want.
- Flemlord 19y agoThanks. I just overnighted it from Amazon. My coding partner wants to use recursive database queries to do this--I want to avoid it because it's slower, breaks our object model, and makes the application non-database-agnostic. (Currently, we're using NHibernate and can run on most major databases.)
- tim2 19y agoOn the other hand. Just de-normalizing ahead of time can really save you on code complexity and is usually the highest performance setup. So I would say, de-normalize ahead of time and if you find you have performance problems then normalize it. That's the most probable way of avoiding pre-mature optimization:)