Hacker News new | past | comments | ask | show | jobs | submit login

Cross-tabulation is not about denormalization. If anything, it is about producing the reports you want while keeping your data normalized.



It creates repeating groups (gender -> M,F; location -> Boston, Cagliari, etc; dept -> Development, Personel, etc)—to me, that looks like denormalization.

I'm not sure this is what you're objecting to, but whether or not the data is _stored_ denormalized (as opposed to just using the result set and throwing it away), is not really of consequence. I think we'll both agree that we can and should keep our transactional data normalized.

Either way, this method goes against the grain of what SQL is supposed to do (otherwise you could meta-program queries without having to resort to a Perl script to string this thing together). My critique still stands that these queries can grow to intractable sizes.

If one is going to be a lot of reporting like this, they should really look to separate their transactional and analytical databases.

But hey, like I said YMMV. In a simple case it works. But trust me when I say, after 5 years of data growth and requirements shifts, I wish I knew then the burden that it is now. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: