Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I suspect that Julia is solely using the first kind of mental model (getting the correct result), and completely ignoring query planning. But even this model has an order to it! Three examples of how this order can manifest, that should all agree with each other:

1. The explanatory diagrams that Julia drew for the talk. These wouldn't make sense if they were in a different order.

2. The order of operations you would perform if you developed a proof of concept SQL implementation that completely ignored performance. In this example the order would be: "cats, filter, group, filter, map, sort". This is exactly the order that Julia's explanation showed.

3. The relational logic expression for this query. There should be a correspondence between this expression and this ordered list of operations, though it's somewhat annoying to state. I think it's that, assuming all the operators in the relational logic expression are binary, if you reverse the order that a subset of the operators are written in, then the operators in the tree occur in the same order as the ordered list of operations. (I don't actually know relational logic, so I'm making a prediction here. This prediction is falsifiable: you can't put the operators in the tree in an arbitrary order.)

(Side note: the order isn't completely fixed. The last two steps --- SELECT and ORDER BY --- could happen in either order.)



If there's an index on the ORDER BY fields, it can even be first.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: