Commit graph

17 commits

Author SHA1 Message Date
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Sergei Petrunia
44fdb56c97 MDEV-8646: Re-engineer the code for post-join operations
- Make EXPLAIN code use the post-join operations
- Remove Sort_and_group_tracker that was used for that purpose
2016-03-28 12:02:56 +03:00
Sergei Golubchik
5f510a9175 Merge branch '5.5' into 10.0 2015-03-06 18:41:32 +01:00
Sergei Golubchik
d7d19071d2 MDEV-6838 Using too big key for internal temp tables
update test results after the fix
2015-03-06 17:03:46 +01:00
Sergey Petrunya
e4521f8cae Merge 2014-10-29 15:20:46 +03:00
Sergey Petrunya
30b28babdc Merge 5.3->5.5 2014-10-29 13:22:48 +03:00
Sergey Petrunya
a8341dfd6e MDEV-6879: Dereference of NULL primary_file->table in DsMrr_impl::get_disk_sweep_mrr_cost()
(Backport to 5.3)
(Attempt #2)
- Don't attempt to use BKA for materialized derived tables. The 
  table is neither filled nor fully opened yet, so attempt to 
  call handler->multi_range_read_info() causes crash.
2014-10-29 01:46:05 +03:00
Sergey Petrunya
94c8f33569 MDEV-6888: Query spends a long time in best_extension_by_limited_search with mrr enabled
- TABLE::create_key_part_by_field() should not set PART_KEY_FLAG in field->flags
  = The reason is that it is used by hash join code which calls it to create a hash
    table lookup structure. It doesn't create a real index.
  = Another caller of the function is TABLE::add_tmp_key(). Made it to set the flag itself.

- The differences in join_cache.result could also be observed before this patch: one
  could put "FLUSH TABLES" before the queries and get exactly the same difference.
2014-10-29 01:20:45 +03:00
Sergey Petrunya
1a996bde1e MDEV-6879: Dereference of NULL primary_file->table in DsMrr_impl::get_disk_sweep_mrr_cost()
(Attempt #2)
- Don't attempt to use BKA for materialized derived tables. The 
  table is neither filled nor fully opened yet, so attempt to 
  call handler->multi_range_read_info() causes crash.
2014-10-20 23:35:34 +04:00
Sergey Petrunya
1c6fc3f6b9 [SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
Part 2 of:
- Pass more tests
- select with subselects is now shown with type=PRIMARY where it used to be (incorrectly) 'SIMPLE'
2013-06-18 19:21:00 +04:00
Sergei Golubchik
a48a91d90f 5.3->5.5 merge 2012-11-22 10:19:31 +01:00
unknown
dd2d59924e MDEV-3801
Adjust unstable test case.
2012-11-19 18:17:46 +02:00
unknown
60a7b05871 MDEV-3801 Reproducible sub select join crash on 5.3.8 and 5.3.9
Properly drop all unused keys.
Patch by Igor Babaev.
2012-11-19 15:38:27 +02:00
unknown
941018f8d1 Patch for mdev-287: CHEAP SQ: A query with subquery in SELECT list, EXISTS, inner joins takes hundreds times longer
Analysis:

The fix for lp:944706 introduces early subquery optimization.
While a subquery is being optimized some of its predicates may be
removed. In the test case, the EXISTS subquery is constant, and is
evaluated to TRUE. As a result the whole OR is TRUE, and thus the
correlated condition "b = alias1.b" is optimized away. The subquery
becomes non-correlated.

The subquery cache is designed to work only for correlated subqueries.
If constant subquery optimization is disallowed, then the constant
subquery is not evaluated, the subquery remains correlated, and its
execution is cached. As a result execution is fast.

However, when the constant subquery was optimized away, it was neither
cached by the subquery cache, nor it was cached by the internal subquery
caching. The latter was due to the fact that the subquery still appeared
as correlated to the subselect_XYZ_engine::exec methods, and they
re-executed the subquery on each call to Item_subselect::exec.

Solution:

The solution is to update the correlated status of the subquery after it has
been optimized. This status consists of:
- st_select_lex::is_correlated
- Item_subselect::is_correlated
- SELECT_LEX::uncacheable
- SELECT_LEX_UNIT::uncacheable
The status is updated by st_select_lex::update_correlated_cache(), and its
caller st_select_lex::optimize_unflattened_subqueries. The solution relies
on the fact that the optimizer already called
st_select_lex::update_used_tables() for each subquery. This allows to
efficiently update the correlated status of each subquery without walking
the whole subquery tree.

Notice that his patch is an improvement over MySQL 5.6 and older, where
subqueries are not pre-optimized, and the above analysis is not possible.
2012-05-30 00:18:53 +03:00
unknown
764eeeee74 Fix for LP BUG#910123 MariaDB 5.3.3 causes 1093 error on Drupal
Problem was that now we can merge derived table (subquery in the FROM clause).
Fix: in case of detected conflict and presence of derived table "over" the table which cased the conflict - try materialization strategy.
2012-02-14 16:52:56 +02:00
Igor Babaev
2092436457 Merge. 2011-07-21 15:55:08 -07:00
Igor Babaev
63abf00a62 Made the optimizer switches 'derived_merge' and 'derived_with_keys'
off by default.
2011-07-21 14:23:08 -07:00