We're updating the issue view to help you get more done. 

Move the optimization of subqueries earlier, before make_join_select()

Description

Subqueries in MariaDB 5.5/5.3 are optimized recursively close to the end of JOIN::optimize through the call to JOIN::optimize_unflattened_subqueries.

This turns out to be a problem for the implementation of (Cost-based choice for the pushdown of expensive predicates to joined tables), because predicate pushdown is performed by make_join_select() which is called earlier than JOIN::optimize_unflattened_subqueries. If subqueries are optimized after make_join_select(), then their cost is unknown during predicate pushdown, and we cannot estimate if a subquery is expensive or not.

The goal of this task is to move subquery optimization before make_join_select.

Environment

None

Status

Assignee

Timour Katchaounov

Reporter

Timour Katchaounov

Time Tracking

8h

Fix versions

Due date

2012/07/10

Priority

Major