Commit graph

25 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
Igor Babaev
dbeffabc83 Fixed the bug mdev-11574.
Do not build an index merge of two indexes when one index is
an infix of the other index.
2017-10-06 00:08:36 -07:00
Vicențiu Ciorbaru
1acfa942ed Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
Igor Babaev
f003cc8a35 Fixed bug mdev-8603.
When building different range and index-merge trees the range optimizer
could build an index-merge tree with an index scan containing less ranges
then needed. This index-merge could be chosen as the best. Following this
index-merge the executioner missed some rows in the result set.
The invalid index scan was built due to an inconsistency in the code
back-ported from mysql into 5.3 that fixed mysql bug #11765831:
the code added to key_or() could change shared keys of the second
ored tree. Partially the problem was fixed in the patch for mariadb
bug #823301, but it turned out that only partially.
2017-01-18 11:42:41 -08:00
Sergey Petrunya
fb6183a80b MDEV-5244: Make extended_keys=ON by default in 10.0
- Change the default flag value to ON.
- Update the testcases to be run extended_keys=ON:
  = trivial test result updates
  = If extended_keys setting makes a difference for a testcase, run the testcase 
    with extended_keys=off. There were only a few such cases
- Update to vcol_select_innodb looks like a worse plan but it will be gone in 10.0.
2014-02-25 01:18:13 +04:00
Sergei Golubchik
9b9c138e2a small cleanups 2013-01-15 19:16:18 +01:00
Igor Babaev
7714739b2d Fixed bug mdev-585 (LP bug #637962)
If, when executing a query with ORDER BY col LIMIT n, the optimizer chose
an index-merge scan to access the table containing col while there existed
an index defined over col then optimizer did not consider the possibility
of using an alternative range scan by this index to avoid filesort. This
could cause a performance degradation if the optimizer flag index_merge was
set up to 'on'.
2012-11-01 14:54:33 -07:00
Igor Babaev
357331af8a Fixed LP bug #954262.
This bug in the constructor SEL_IMERGE::SEL_IMERGE could 
cause huge excessive memory requests.
2012-03-20 17:03:28 -07:00
Igor Babaev
6ed9c13643 Fixed LP bug #891953.
Due to this bug the function SEL_IMERGE::or_sel_tree_with_checks()
could build an inconsistent merge tree if one of the SEL_TREEs in the
resulting index merge happened to contain a full key range.
This could trigger an assertion failure.
2011-11-18 09:35:51 -08:00
Igor Babaev
3433cf3e4f Fixed LP bug #800184.
The function key_and() erroneously called SEL_ARG::increment_use_count()
when SEL_ARG::incr_refs() should had been called. This could lead to
wrong values of use_count for some SEL_ARG trees.
2011-11-18 04:41:25 -08:00
Igor Babaev
28b2eaa81a Fixed LP bug #823301.
A bug in the code of the function key_or could lead to a situation
when performing of an OR operation for one index changes the result
the operation for another index. This bug is fixed with this patch.

Also corrected the specification and the code of the function 
or_sel_tree_with_checks.
2011-11-12 02:20:44 -08:00
Igor Babaev
79439d9a74 Fixed LP bug #752353.
In some cases the field max_part_no of the SEL_ARG structure
was not initialized. That triggered a Valgrind complain.
2011-04-20 15:30:21 -07:00
Igor Babaev
212e42263d Merge. 2010-12-10 01:17:09 -08:00
Igor Babaev
c4080280df Merge 2010-12-09 21:55:14 -08:00
Igor Babaev
afcefa97d9 Addemdum for bug #685952.
Also:
Changed the value of TIME_FOR_COMPARE_ROWID to make it the same as for MWL 21.
Changed some queries in range_vs_index_merge.test to make them generate
the same plans as earlier.
2010-12-09 11:06:32 -08:00
Igor Babaev
f5a0595209 Corrected the bug number in a test case. 2010-12-07 19:51:48 -08:00
Igor Babaev
c44c9207f0 Fixed LP bug #685952.
When ORing two AND-OR formulas the range optimizer could miss
a conjunct in one of AND-OR formulas in the result. If the
index merge union plan to access a table is formed by this 
formula that, in general, is not inferred from the original
where/on condition,the query could return an incorrect result set.
2010-12-07 12:14:28 -08:00
Igor Babaev
67180d655a Fixed LP bug #684117.
A crash may happenin the cases when the range optimizer tried to OR
two index merge such that the second one contained less range trees
than the first one.
The bug was introduced by the patch of MWL#24: 
"index_merge: fair choice between index_merge union and range access".
2010-12-05 19:09:37 -08:00
Igor Babaev
bfb7727526 Fixed LP bug #684117.
A crash may happenin the cases when the range optimizer tried to OR
two index merge such that the second one contained less range trees
than the first one.
The bug was introduced by the patch of MWL#24: 
"index_merge: fair choice between index_merge union and range access".
2010-12-04 19:19:55 -08:00
Igor Babaev
25704af0b2 Adjusted results in suite/innodb_plugin/r/innodb_mysql.result.
Made range_vs_index_merge.test platform independent
2010-12-04 10:40:07 -08:00
Igor Babaev
80377bbf6d MWL #21: "index_merge: non-ROR intersection".
The second (final) patch.
2010-12-01 23:39:39 -08:00
Igor Babaev
1a3bb0c5c2 Fixed bug #637978.
Fixed a bug in the new code for WL#24 that caused generation of
an invalid index-merge access plan.
2010-09-15 16:42:56 -07:00
Igor Babaev
27191a30c0 Replaced a lame implementation of the function sel_trees_must_be_ored
that blocked building index merge plans for the queries with where
conditions of the form 
(key1|2_p1=c AND range(key1_p2)) OR (key1|2_p1=c AND range(key2_p2)).

The problem was discovered by Sergey Petrunia when he reviewed the patch
for WL#24.

Added new test cases. One of them failed to produce an index merge plan
before the patch was applied.
2009-10-29 11:49:58 -07:00
Igor Babaev
9d39a13761 Changed test cases to make results for innodb platform independent. 2009-10-17 11:40:46 -07:00
Igor Babaev
3019d39729 The main patch for WL#24:
"index_merge: fair choice between index_merge union and range access"

mysql-test/include/world.inc:
  A new include file to upload the world database.
mysql-test/include/world_schema.inc:
  A new include file to create tables of the world database.
mysql-test/r/index_merge_myisam.result:
  The results for test cases testing the optimizations added in WL#24 for MyISAM.
mysql-test/r/range_vs_index_merge.result:
  The results for test cases testing the optimizations added in WL#24 for InnoDB.
mysql-test/t/range_vs_index_merge.test:
  Test cases to test the optimizations added in WL#24 for MyISAM.
mysql-test/t/range_vs_index_merge_innodb.test:
  Test cases to test the optimizations added in WL#24 for InnoDB.
sql/sql_list.h:
  Fixed a bug that did not allow adding a non-empty list to an empty list.
2009-10-11 21:59:34 -07:00