[MDEV-4852] Too inefficient query plan for more complex JOIN/SUBQUERY conditions Created: 2013-08-07 Updated: 2013-08-21 Resolved: 2013-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.32 |
| Fix Version/s: | 5.5.33 |
| Type: | Bug | Priority: | Major |
| Reporter: | stark skalle | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | optimizer | ||
| Environment: |
Windows 7 64bit, PHP 5.3.8 |
||
| Attachments: |
|
| Description |
|
SQL:
There is huge performance difference between MySQL (>1s) and MariaDB (>60s). The problem is in here "ud_makler.id_udalost_akce IN (4,5,8,9,10)" - if changed to for example "ud_makler.id_udalost_akce IN (4)" than the query has roughly same speed as MySQL. Including explains fot the query above for MySQL (5.5.16) and MariaDB. I hope this was not reported yet... |
| Comments |
| Comment by Igor Babaev [ 2013-08-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you provide a test case for this problem? Thanks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by stark skalle [ 2013-08-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Igor, I am new to MariaDB JIRA - what should a test case involve? Thanks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2013-08-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just an instruction/description of how the problem could be reproduced.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by stark skalle [ 2013-08-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have added database dump - run the query from the description to replicate the issue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reproducible with the attached data (just execute test.sql and then the query from the description). On current MariaDB 5.5: On current MySQL 5.5: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Patryk Pomykalski [ 2013-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You can add index hint as a workaround: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2013-08-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This problem is also seen in mysql-5.6.13:
---
--- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2013-08-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like this a manifestation of a more general problem that affects all versions of MariaDB/MySQL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2013-08-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This problems was fixed by the patch for bug mdev-4894 that has been pushed into the 5.1 tree and later merged into the 5.2, 5.3, 5.5 trees. |