[MDEV-23634] Select query hanged the server and leads to OOM in MariaDB 10.4.14 Created: 2020-09-01 Updated: 2023-04-18 Resolved: 2021-04-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.1, 10.4.14, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4.19, 10.5.10 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Nilnandan Joshi | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Hi Team, Select query hanged the server with high memory usage and leads to OOM in MariaDB 10.4.14.
Query is something like
There is a long list of sys_id != and condition.
Required table structures and query is attached with this bug. |
| Comments |
| Comment by Elena Stepanova [ 2020-09-21 ] | ||||||||||||||||||
|
Reproducible as described – create the tables from lq1.tables To avoid OOM, it may make sense to set max-session-mem-used introduced in However, the problem itself still needs to be looked at. MySQL 5.7 and 8.0 return the plan in seconds, while all of MariaDB 10.1-10.5 keep processing this EXPLAIN endlessly (I didn't wait till OOM and interrupted each time around 5G and several minutes of execution). A couple of consequent selects from performance_schema on 10.5.5:
| ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-03-19 ] | ||||||||||||||||||
|
One doesn't need most of the query, this part with a lot of non-equalities is sufficient:
| ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-03-19 ] | ||||||||||||||||||
|
The tree I'm trying this on has this fix, but it doesn't help (because it's about NOT IN, not individual non-equalities):
| ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-04-06 ] | ||||||||||||||||||
|
Developed an analog of the fix for
| ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-04-07 ] | ||||||||||||||||||
|
Patch: http://lists.askmonty.org/pipermail/commits/2021-April/014538.html | ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-04-07 ] | ||||||||||||||||||
|
bb-10.5-mdev23634 | ||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-04-08 ] | ||||||||||||||||||
|
bb-10.4-mdev23634 |