← Back to team overview

maria-developers team mailing list archive

Re: MWL83: review


Hi Timour,

Found another possible issue:

The code in best_extension_by_limited_search() calls
join->static_pushdown_cost(). static_pushdown_cost() may modify
join->position[$I].read_time for any $I.

Now, consider an example:

  SELECT * FROM t1,t2,t3 WHERE subquery_conditions

The join optimizer will consider join orders:

S1:  t1
S2:  t1 t2
S3:  t1 t2 t3
S4:  t1 t3 t2

On step S3, we will get a complete join order, and the new code in 
best_extension_by_limited_search() is invoked. It will call 
join->static_pushdown_cost(...) which may change the value of 


On step S4, we again will get a complete join order. The new code in
best_extension_by_limited_search() is invoked, it will call
join->static_pushdown_cost(...), which again may change


Now, that value will be meaningless.


Sergei Petrunia, Software Developer
MariaDB | Skype: sergefp | Blog: http://s.petrunia.net/blog