bugs.core_5146_test. Suboptimal join order if one table has a selective predicate and MIN is calculated for the other one