|
|
|
|
|
by _a_a_a_
1260 days ago
|
|
FYI for others, such filtering is called predicate pushdown (I believe also called predicate hoisting sometimes). Example (and this is trivial but for illustration) select * from (select * from tbl) as subqry where subqry.col = 25
would be rewritten by any halfway decent optimiser to select * from (select * from tbl where tbl.col = 25)
(and FTR the outermost select * would be stripped off as well).Good DB optimisers do a whole load of that and much more. |
|
Joining onto either table a or table b is something that REALLY trips optimizers up.