[MDEV-4626] Setting join_buffer_size causes join buffer not to be used Created: 2013-06-08 Updated: 2018-01-16 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.2, 5.5.31 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.30 | ||||||||
| Description |
|
I was experimenting with join buffering. I made a big table:
And ran a query that uses join buffer:
Then I run the corresponding SELECT. In debugger, I saw execution reach JOIN_CACHE::alloc_buffer(), where it allocated a buffer of ~130Kbytes in size. Everything is ok so far. Then, I decided to try with a bigger join buffer. I did
and run the query again. EXPLAIN remained the same. As for SELECT, I notice that JOIN_CACHE::alloc_buffer() doesn't call my_malloc() anymore.
and it takes the "if" and executes "goto fail". Whatever it is, it must not work like this. Increasing @@join_buffer_size should not switch one from using join buffering to not using it. It is a very nasty performance surprise (especially since EXPLAIN gives one no clue that join buffer won't be used anymore). I was using all default settings. |
| Comments |
| Comment by Sergei Petrunia [ 2013-06-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Relevant variables:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2013-06-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If I set @@join_buffer_space_limit to be 11M, then I see JOIN_CACHE::alloc_buffer() to allocate 10M. I'm wondering what should happen when @@join_buffer_space_limit < @@join_buffer_size. I think,
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I see the following relatively acceptable solutions:
What of this should be done, or who should make this decision, who should actually do it, and in which version? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Chris Calender (Inactive) [ 2016-04-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We now have a customer experiencing repeated crashing when join_buffer_size = join_buffer_space_limit. These were the related settings they had set: join-buffer-space-limit = 4M I had them make one change at a time: 1. removing "join-cache-level = 6" did not stop the crashing. Using 10.1.13. Here is a full stack trace from the error log:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2017-12-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Chris, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2017-12-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Chris, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2017-12-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The original reported problem can be easily resolved with this setting | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2017-12-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried to reproduce Chris's problem (in 10.0 and in 10.1) on Sergey's database:
I tried to do it with the following commands
and I failed. |