3 ms·
Boosting speed, fantastic - replacing the completely easy and logical SQL language, not so much: io.file.read('users') | rel.select(username) | rel.group(co
by ck2 15y ago
Boosting speed, fantastic - replacing the completely easy and logical SQL language, not so much:
io.file.read('users') | rel.select(username) | rel.group(count) | rel.order_by(_count);
is
SELECT username, COUNT(1) AS num FROM users GROUP BY username ORDER BY num;
seriously? why?
- matthewnourse 15y agoI hear you, and I would have preferred to use the SQL (or any other well-understood) syntax. Some of the reasons are: 1) I want the query writer to be in complete control over what happens first, rather than a query optimizer. The r17 syntax makes this explicit. 2) Similarly, I want it to be clear which things will be executed in parallel and which won't. 3) I agree that SQL is "completely easy and logical" if your query is small but for large SQL queries I find that I need to understand the query as one big mass. With r17 you can take it one clause at a time. It's a bit like a stack-based language in this respect. You can keep adding clauses at the end of a pipeline, eg WHERE (or even multiple WHEREs) can come after a GROUP BY, ORDER BY etc...contrast this with SQL's need for a special HAVING clause.