[MDEV-2452] LP:686355 - Performance regression with sort_intersection in maria-5.1-wl21 Created: 2010-12-07 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query against the DBT-3 data set is much slower in maria-5.1-wl21 because it gets executed with sort_intersection SELECT COUNT( l_suppkey ) FROM lineitem WHERE (l_suppkey = 3 AND l_partkey = 255 ) OR (l_partkey BETWEEN 111 AND 244); The left side of the OR expression returns zero rows. Each side is easily computable with an index when executed separately. |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-12-07 ] | ||||||||
|
Re: Performance regression with sort_intersection in maria-5.1-wl21 id: 1 statistics: Handler_read_next:4003, Handler_read_key: 2 In maria-5.1-wl21 id: 1 execution time: 0.09
| ||||||||
| Comment by Philip Stoev (Inactive) [ 2010-12-08 ] | ||||||||
|
Re: Performance regression with sort_intersection in maria-5.1-wl21 http://bazaar.launchpad.net/~randgen/randgen/rqg2/files/head:/conf/dbt3/ click the arrow button at the right to download the file | ||||||||
| Comment by Philip Stoev (Inactive) [ 2010-12-08 ] | ||||||||
|
Re: Performance regression with sort_intersection in maria-5.1-wl21 bzr branch lp:~maria-captains/maria/maria-5.1-wl21 bug686355 cd bug686355 ./BUILD/compile-pentium-debug-max-no-ndb bzip2 -d dbt3-s0.01.dump.bz2 MTR_VERSION=1 perl mysql-test-run.pl - Then run SELECT COUNT( l_suppkey ) FROM lineitem WHERE (l_suppkey = 3 AND l_partkey = 255 ) OR (l_partkey BETWEEN 111 AND 244); The plan you should get is mysql> explain SELECT COUNT( l_suppkey ) FROM lineitem WHERE (l_suppkey = 3 AND l_partkey = 255 ) OR (l_partkey BETWEEN 111 AND 244)\G
which is slower than the one with sort_intersection=off | ||||||||
| Comment by Igor Babaev [ 2010-12-23 ] | ||||||||
|
Re: Performance regression with sort_intersection in maria-5.1-wl21 MariaDB [test]> select count
----------
---------- MariaDB [test]> SET SESSION optimizer_switch='index_merge_sort_intersection=on'; MariaDB [test]> explain SELECT COUNT( l_suppkey ) FROM lineitem WHERE (l_suppkey = 3 AND l_partkey = 255 ) OR (l_partkey BETWEEN 111 AND 244)\G
| ||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||
|
Launchpad bug id: 686355 |