Does `SELECT` really come before `ORDER BY` (either in practice or even theoretically)? Then you need to evaluate the _complete result set_ before sorting and serving it?
-
-
-
definitely in practice the order of all these things is different -- i think it might be more correct to think of it as order by -> select because you can order by something that isn't in the select
- Show replies
New conversation -
-
-
You have a gift. I plan on checking out your website. Thanks!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Ooo this is a really cool visualization.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This is really great! Just wondering about one thing: given the query doesn’t seem to use the ‘name’ column at all, I’m wondering if the names could/would be optimised out earlier in the sequence? It’s great to look at it like this to try different mental models!
-
yeah, what actually happens when the database runs the query is often really different from this (If you want to actually know, you can get the db to tell you its query plan!)
- Show replies
New conversation -
-
-
I am wondering if HAVING comes before the SELECT where the collapsing for the GROUP BY happens in your viz. If the aggregation is complex, it should calculate it (therefore collapse it) before sub setting, no?
-
no, that was on purpose! You can filter by something in HAVING that isn't in your SELECT (like select count(*) from x group by z HAVING max(thing) = y)
- Show replies
New conversation -
-
-
These are legitimately fantastic. Thank you for putting them together and sharing them
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Waiting for the sql book :)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.