3 ms·
I hate to criticize but this stood out to me: > SELECT * FROM users WHERE name = 'jorge' ORDER BY age; > Can we tell from the query if this is the case? No,
by orf 11y ago
I hate to criticize but this stood out to me:
> SELECT * FROM users WHERE name = 'jorge' ORDER BY age;
> Can we tell from the query if this is the case? No, we can't. You'd have to look it up.
and then:
> r.table('users').filter({ name: 'jorge' }).orderBy(r.desc('age'))
> Now, can you tell from the query if the users are filtered or ordered first? Yes! filter comes first.
The filter comes first in both queries. It's exactly the same.
The part about indexes is interesting though.
- arundelo 11y agoThe author's point here is that in ReQL the order things happen in is the order you write them in, which is not the case in SQL. (In SQL the order things happen in is partially baked into the language -- see the page that "look it up" links to in the article -- and partially at the discretion of the query plan optimizer.)