Re:Mixpanel: Introducing JQL, a query language to analyze an...
by batbomb on Thursday April 14, 2016 @03:51PM
(#11499816)
Views and WITH statements help out quite a bit for this, though it does depend on the database. In general, basic views are well-supported across all RDBMS. If your database supports it, Materialized Views are amazing for the caching of certain complex queries and reusability, and that's something SQLAlchemy can't do by itself.
Re:Mixpanel: Introducing JQL, a query language to analyze an...
by dwmintz on Friday April 15, 2016 @12:51PM
(#11505745)
Totally agree and the "write-only" nature of SQL is something that makes me crazy. Sounds like you're more of a dev. I'm an analyst, but same problem. For any analytic SQL I wrote more than a couple weeks ago, I end up throwing it out and starting from scratch because it's so hard to understand anything I wrote.
ORMs were a huge step forward for devs, but there wasn't really anything similar for analysts. Looker (where I now work after three years as a customer) is, in many ways, the equivalent of an ORM for analytics.
The only thing I loathe about SQL is its lack of re-usability. It is hard to write reusable parts and pass them around in functions. Need ten filters which you may / may not use? Write ten queries!
Thankfully, the problem is solved by ORMs ( SQLAlchemy, in my case ). Certainly, in many cases, the mental mapping of map, filter and reduce makes more sense but in the most, I have been more comfortable with using a powerful ORM layer and SQL.