[MDEV-8857] [Upstream too] EXPLAIN incorrectly shows Distinct for tables using join buffer Created: 2015-09-27 Updated: 2016-04-17 Resolved: 2016-04-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.0, 10.1 |
| Fix Version/s: | 10.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
EXPLAIN may show "Distinct" for tables that use join buffer. This is not a possible execution strategy, one can debug and confirm that Distinct optimization is not used in this case. Copying from my report to upstream:
Look at the second query. It has "Distinct". I think this wrong. "Distinct" To make sure we are on the same page: "Distinct" in table B means that as soon |
| Comments |
| Comment by Sergei Petrunia [ 2015-09-27 ] | |||||||||||||||||||||||||
|
Quoting my comment for upstream: You can see Distinct in action: put a breakpoint in end_write and end_send.
Then,
Ok, now with "Using join buffer": set optimizer_switch='block_nested_loop=on';
When one takes time to think about, it becomes obvious that "Distinct" | |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-09-27 ] | |||||||||||||||||||||||||
|
For the record: this was discovered when analyzing | |||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2016-04-17 ] | |||||||||||||||||||||||||
|
This was fixed as part of |