[MDEV-17011] “condition_pushdown_for_derived” optimization not used when using INSERT INTO Created: 2018-08-17 Updated: 2018-08-21 Resolved: 2018-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2.17, 10.2, 10.3 |
| Fix Version/s: | 10.2.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Risato Stefano | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | condition_pushdown_for_derived | ||
| Environment: |
ubuntu server 16.04 64bit |
||
| Description |
|
“condition_pushdown_for_derived” optimization correctly use index withing a simple SELECT query, but don't use it if the result records are inserted into an existing table. Steps to reproduce: CREATE TABLE `tbl` ( INSERT INTO `tbl` (`a`, `b`) VALUES CREATE TABLE `tbl2` ( Simple select query: EXPLAIN
Adding INSERT INTO index is no more used: EXPLAIN
For comparison, i tried a query without GROUP BY (in this case the optimization involved is derived_merge), and the optimization is maintained when using INSERT INTO EXPLAIN
EXPLAIN
|
| Comments |
| Comment by Alice Sherepa [ 2018-08-17 ] | |||||||||||||||||||||||||||
|
Thanks for the report!
| |||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2018-08-21 ] | |||||||||||||||||||||||||||
|
A fix for this bug was pushed into 10.2 |