I read on SO that join is performed before where so I was wondering if it is (always) a good idea to perform a join like so:
SELECT * FROM
(SELECT * FROM tbl_1 WHERE field = 'the_value') t
JOIN tbl_2 USING (joinable_field)
instead of the usual
SELECT * FROM tbl_1 t1 JOIN tbl_2 t2 USING (joinable_field)
WHERE t1.field = 'the_value'
With this, you are restricting the execution and evaluation order.
tmust be created first (maybe “on the fly”, maybe physially on disk), andtbl_2is joined in.In your concrete case, this shouldn’t hurt, however. But I cannot see a benefit, either.