News for hackers. Stuff that matters.
Re:The SQL filter clause: selective aggregates by smt88 on Monday May 30, 2016 @06:15PM (#11803527)
SQL is a lot like JavaScript: a lot of people hate working with it, but it's the only practical choice, as you say.

It's interesting to note that transpiling to SQL is even more popular than the recent trend of transpiling to JavaScript. Every major language has a query builder (many of which end up with syntax similar to Andl). We're abstracting away from SQL and have been for a long time.

With that in mind, I wonder whether we need a new query language so desperately. SQL is so highly optimized in the major RDBMS that any new language would probably compile internally to SQL, meaning it has the same semantics (and is essentially sugar) OR it would be way behind SQL in terms of optimization.

Am I just totally off base here?

Re:The SQL filter clause: selective aggregates by pjungwir on Monday May 30, 2016 @06:37PM (#11803614)
After I wrote that comment I thought it might be worth submitting this Andl story to HN about Andl-on-Postgres: [0]. They write, "Relational expressions are converted into equivalent SQL and passed back to the Postgres SPI interface for execution," so you are right about transpiling. But the software world is more mature than it was 20 years ago, so it seems reasonable for a project to get a toehold by building on top of existing systems. That needn't limit its future growth necessarily. It sounds like Andl will work on more than just Postgres, so I can imagine them eventually building a "native" version too. Using existing RDBMSes is a pretty good way to get an MVP though. :-)

[0] https://news.ycombinator.com/item?id=11802917

Re:The SQL filter clause: selective aggregates by smt88 on Monday May 30, 2016 @07:37PM (#11803805)
> Relational expressions are converted into equivalent SQL and passed back to the Postgres SPI interface for execution

I actually don't think I like that approach.

If I transpile my own queries (meaning I use a query builder), then I can cache the generated SQL. There would be some placeholders for arguments, but the query itself doesn't change.

Andl's approach could add significant overhead in certain applications where lots of queries are being executed at once.

And then what happens to EXPLAIN support? Is it harder to debug an Andl query?