4 ms·
I agree with everything you've said, however I want to add that the general technique of compressing your data through pre-aggregation is a sound one, whether i
by pradocchia 13y ago
I agree with everything you've said, however I want to add that the general technique of compressing your data through pre-aggregation is a sound one, whether it is performed auto-magically by the optimizer, or manually through whatever hooks your DMBS provides.
- bentcorner 13y agoWhile it's hard to deny the results, the human readability of the final solution leaves a lot to be desired, especially for SQL casuals.
- calinet6 13y agoAt least with Postgres (and MySQL to some degree, but Postgres is probably a better launching point), you could hack the query optimizer to handle situations like this if you really wanted to. I like to think this is how Postgres would like you to approach the problem, instead of creating a less comprehensible query.