summaryrefslogtreecommitdiff
path: root/mysql-test/main/in_subq_cond_pushdown.result
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-27036: resolve duplicated key issues of JSON tracing outputs:Sergei Krivonos2021-11-261-1280/+1707
| | | | | | | | | | | MDEV-27036: repeated "table" key resolve for print_explain_json MDEV-27036: duplicated keys in best_access_path MDEV-27036: Explain_aggr_filesort::print_json_members: resolve duplicated "filesort" member in Json object MDEV-27036: Explain_basic_join:: print_explain_json_interns fixed start_dups_weedout case for main.explain_json test
* Merge branch '10.4' into bb-10.4-mdev7486bb-10.4-mdev7486Igor Babaev2019-02-191-2/+2
|\
| * MDEV-17903: New optimizer defaults: change optimize_join_buffer_size to be ONVarun Gupta2019-02-191-2/+2
| | | | | | | | optimize_join_buffer_size is switched ON.
* | MDEV-18635 The test case for bug mdev-16727 crashes the serverGalina Shalygina2019-02-181-1/+12
| | | | | | | | | | | | | | in the tree bb-10.4-mdev7486 The crash was caused because after merge of bb-10.4-mdev7486 and 10.4 branches changes for mdev-16727 were missing.
* | MDEV-7486: Condition pushdown from HAVING into WHEREGalina Shalygina2019-02-171-11/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Condition can be pushed from the HAVING clause into the WHERE clause if it depends only on the fields that are used in the GROUP BY list or depends on the fields that are equal to grouping fields. Aggregate functions can't be pushed down. How the pushdown is performed on the example: SELECT t1.a,MAX(t1.b) FROM t1 GROUP BY t1.a HAVING (t1.a>2) AND (MAX(c)>12); => SELECT t1.a,MAX(t1.b) FROM t1 WHERE (t1.a>2) GROUP BY t1.a HAVING (MAX(c)>12); The implementation scheme: 1. Extract the most restrictive condition cond from the HAVING clause of the select that depends only on the fields that are used in the GROUP BY list of the select (directly or indirectly through equalities) 2. Save cond as a condition that can be pushed into the WHERE clause of the select 3. Remove cond from the HAVING clause if it is possible The optimization is implemented in the function st_select_lex::pushdown_from_having_into_where(). New test file having_cond_pushdown.test is created.
* MDEV-17027 server crashes in Bitmap<64u>::mergeIgor Babaev2018-10-171-0/+19
| | | | | | | | The function and_new_conditions_to_optimized_cond() incorrectly handled the WHERE conditions with one multiple equality and one IN subquery predicate that could be converted into a jtbm semi-join. This could cause crashes. The fix code was prepared by Galina Shalygina.
* MDEV-17360 Server crashes in optimize_keyuseIgor Babaev2018-10-071-0/+13
| | | | | | | | | | | | | | This was a bug in the code of MDEV-12387 "Push conditions into materialized subqueries". The bug manifested itself in rather rare situations. An affected query must contain IN subquery predicate whose left operand was an outer field of a mergeable derived table or view and right operand was a materialized subquery. The erroneous code in fact stripped off the Item_direct_ref wrapper from the left operand of the IN subquery predicate when building equalities produced by the conversion of the predicate into a semi-join. As a result the left operand was not considered as an outer reference anymore and used_tables() was calculated incorrectly. This caused a crash in the function optimize_keyuse().
* MDEV-16727: Server crashes in Item_equal_iterator<List_iterator_fast, ↵Galina Shalygina2018-08-011-0/+24
| | | | | | | Item>::get_curr_field() The bug appeares because of the lamely saved list of multiple equalities. To fix it and_new_conditions_to_optimized_cond() was changed.
* MDEV-16730: Server crashes in Bitmap<64u>::mergeGalina Shalygina2018-07-291-0/+17
| | | | | | | | The problem appears because of the pushdown of a non-pushable condition 'cond' into the materialized derived table/view. To prevent pushdown a map of tables that are used in 'cond' should be updated. This call is missing because of the MDEV-12387 changes. The call is added in the setup_jtbm_semi_joins() method.
* MDEV-16721: Assertion `ctx.compare_type_handler()->cmp_type() != STRING_RESULT'Galina Shalygina2018-07-271-0/+12
| | | | | | | | | | | failed The bug appeared as in MDEV-12387 setup_jtbm_semi_joins() procedure had been devided into two functions, one called before optimization of WHERE clause and another after this optimization. When the second function was called for a degenerated jtbm semi join equalities connecting the subselect and the parent select were created but invocation of fix_fields() for these equalities was missing.
* Merge branch '10.3' into 10.4Igor Babaev2018-06-031-9/+12
|
* MDEV-12387 Push conditions into materialized subqueriesGalina Shalygina2018-05-151-0/+3801
The logic and the implementation scheme are similar with the MDEV-9197 Pushdown conditions into non-mergeable views/derived tables How the push down is made on the example: select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 group by x); --> select * from t1 where a>3 and b>10 and (a,b) in (select x,max(y) from t2 where x>3 group by x having max(y)>10); The implementation scheme: 1. Search for the condition cond that depends only on the fields from the left part of the IN subquery (left_part) 2. Find fields F_group in the select of the right part of the IN subquery (right_part) that are used in the GROUP BY 3. Extract from the cond condition cond_where that depends only on the fields from the left_part that stay at the same places in the left_part (have the same indexes) as the F_group fields in the projection of the right_part 4. Transform cond_where so it can be pushed into the WHERE clause of the right_part and delete cond_where from the cond 5. Transform cond so it can be pushed into the HAVING clause of the right_part The optimization is made in the Item_in_subselect::pushdown_cond_for_in_subquery() and is controlled by the variable condition_pushdown_for_subquery. New test file in_subq_cond_pushdown.test is created. There are also some changes made for setup_jtbm_semi_joins(). Now it is decomposed into the 2 procedures: setup_degenerate_jtbm_semi_joins() that is called before optimize_cond() for cond and setup_jtbm_semi_joins() that is called after optimize_cond(). New setup_jtbm_semi_joins() is made in the way so that the result of its work is the same as if it was called before optimize_cond(). The code that is common for pushdown into materialized derived and into materialized IN subqueries is factored out into pushdown_cond_for_derived(), Item_in_subselect::pushdown_cond_for_in_subquery() and st_select_lex::pushdown_cond_into_where_clause().