I have a problem with where clause ordering.
I saw from other questions that order of where clause doesn't effect performance of sql query, but my query performance changes as I change order.
select sql_no_cache idx
from rr
where (timestamp >= '2016-11-28' and timestamp <= '2016-12-28')
and ((select name from xx where midx=rr.midx) like 'test'
is faster than
select sql_no_cache idx
from rr
where ((select name from xx where midx=rr.midx) like 'test'
and (timestamp >= '2016-11-28' and timestamp <= '2016-12-28')
table rr has index on 'idx', 'midx' and 'timestamp'
Any idea why??