• unknown's avatar
    MDEV-3812: Remove unneeded extra call to engine->exec() in... · a8fffefa
    unknown authored
    MDEV-3812: Remove unneeded extra call to engine->exec() in Item_subselect::exec, remove enum store_key_result
    
    This task fixes an ineffeciency that is a remainder from MySQL 5.0/5.1. There, subqueries
    were optimized in a lazy manner, when executed for the first time. During this lazy optimization
    it may happen that the server finds a more efficient subquery engine, and substitute the current
    engine of the query being executed with the new engine. This required re-execution of the engine.
    
    MariaDB 5.3 pre-optimizes subqueries in almost all cases, and the engine is chosen in most cases,
    except when subquery materialization found that it must use partial matching. In this case, the
    current code was performing one extra re-execution although it was not needed at all. The patch
    performs the re-execution only if the engine was changed while executing.
    
    In addition the patch performs small cleanup by removing "enum store_key_result" because it is
    essentially a boolean, and the code that uses it already maps it to a boolean.
    a8fffefa
limit_rows_examined.result 35.5 KB