2 ms·
Table row count is a small part of it, what matters is cardinality and fanout from joins after predicates have been pushed down as far as they can. (Assuming th
by barrkel 3y ago
Table row count is a small part of it, what matters is cardinality and fanout from joins after predicates have been pushed down as far as they can. (Assuming there are sane indexes.)
If the database can't see that your predicates will restrict the set of rows at a certain point in the join graph, it is likely to decide to join too much too early with huge table scans.
Bad join order and join strategy is at the heart of most bad plans once you already have indexes in place that cover the expected joins and lookups.