News for hackers. Stuff that matters.
Re:Data denormalization is broken by briHass on Friday September 30, 2016 @02:38PM (#12614358)
To some degree, this looks like premature optimization. That query (on the normalized tables), with the proper indexes and decent hardware, should be plenty fast, even with millions of rows. I would potentially start my optimization by considering if messages could be 'archived' to other tables or considering how long I could cache the query results vs. how often the client would poll.

I've seen small-medium sized systems go way overboard with complicated mechanisms for handling performance problems that they don't, and may never, have.

Re:Data denormalization is broken by jerf on Friday September 30, 2016 @02:59PM (#12614502)
You have to grant blog posts about issues that only appear at scale a certain amount of leeway with their examples. In the wild, if you're writing normalized schemas, traversing 5 tables isn't that difficult and traversing a couple dozen comes up more often than you'd like. It's not hard to run past what a query optimizer can handle.
Re:Data denormalization is broken by sixdimensional on Friday September 30, 2016 @06:21PM (#12615591)
So I agree, premature optimization can often not be necessary.

But let's be crazy for a minute. How much CPU/RAM/disk IO does that query on normalized tables end up using? How much electricity does that query use?

Maybe from a pure efficiency perspective, it takes less energy to query the pre-computed value, than to constantly be recalculating it on every query.

Re:Data denormalization is broken by quickben on Friday September 30, 2016 @08:49PM (#12616068)
Craziness comes later. Usually few years after several developers added not normalized tables, and it all grew organically with multiple apps depending on the data.

When it comes to rdbms shema, you want it optimized and enforced from day one, or the price paid later will be significant.