[MDEV-25639] Performance degradation - Select query Statistics phase exponential performance degradation Created: 2021-05-10 Updated: 2021-05-11 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.5.7, 10.5.9, 10.6.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Paul Veldema | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | innodb, performance, regression | ||
| Environment: |
Debian 10, Both on VM's and Baremetal installs. Tried on fast SSD storage and spinning Disks. Also tried on Machines with memory > diskspace. |
||
| Attachments: |
|
| Description |
|
On our production systems we deployed MariaDB 10.5.9 after extensive testing without problems. However sometimes when the Rubber meets the road you still encounter something that forces you to revert to the previous version (10.1) where the problem did not occur. The problem is 100% reproducible and took it some time to create a test case without our proprietary data structures. I will do some additional testing on other versions also to see which version introduced the regression also and add that to the affected version list. Here the simplified problem case: Table definition:
Generate about 80000 rows of generic test data for this table, make sure there are e-mail addresses in the rows and that more than a few of the fields where there are also indexes on have data in there. Script to create the problematic queries
The Statistics Duration results of these queries with the different sizes:
The bigger the systemid list the exponentially worse the time it takes to do the Statistics phase. On our production environment we have a much bigger table with extra complexities and the actual query there took up to a 1000 seconds. After a little while there were so many of these queries that the database server became unresponsive (even before the max amount of connections was reached) and we had to revert to the former version. Note: I will test some more versions to see if they also have this problem (see the comments) and add that to the affects version list if that also has this. Things like show variables output I will add to the attachments. All mariadb 10.5 version debian packages were retrieved from here: |
| Comments |
| Comment by Paul Veldema [ 2021-05-10 ] | |||||||||||||||||||||||||||||||||||
|
Tested on Mariadb 10.5.7:
With a Statistics duration of 27.818529 with 20000 systemid's version 10.5.7 is almost a factor 7 worse than version 10.5.9.
| |||||||||||||||||||||||||||||||||||
| Comment by Paul Veldema [ 2021-05-10 ] | |||||||||||||||||||||||||||||||||||
|
Tested MariaDB 10.5.8:
With a Statistics of 0.025825 on version 10.5.8 that is similar or a bit better than what we see on mariadb version 10.1.
| |||||||||||||||||||||||||||||||||||
| Comment by Paul Veldema [ 2021-05-10 ] | |||||||||||||||||||||||||||||||||||
|
Tested MariaDB 10.6.0:
Also affected: Statistics 4.442504, just about the same result as version 10.5.9
| |||||||||||||||||||||||||||||||||||
| Comment by Paul Veldema [ 2021-05-10 ] | |||||||||||||||||||||||||||||||||||
|
For completeness the entire profile output for version 10.5.9 (with a list of 20000 systemid's like the other versions):
And the package list:
|