Hacker News new | ask | show | jobs
by Sesse__ 2 days ago
The hypergraph optimizer orders expensive predicates last (where “expensive” is stuff like subqueries). The old (default) optimizer only does reordering more-or-less by accident, AFAIK.
1 comments

> where “expensive” is stuff like subqueries

Subqueries aren't always going to be more expensive

This is true, but the optimizer considers them so. They're more expensive than e.g. adding two ints.

Of course, if they're rewritten to a semijoin or similar, they won't be subqueries anymore or indeed not conditions at all, so sorting them is not applicable.