[MDEV-13783] Index optimiser regression in 10.1.26 and possibly earlier Created: 2017-09-11 Updated: 2021-01-12 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Storage Engine - TokuDB |
| Affects Version/s: | 10.1.26 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | John Barratt | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | index | ||
| Environment: |
Ubuntu Xenial/Trusty |
||
| Issue Links: |
|
||||||||||||
| Description |
|
Since upgrading some of our databases we have started to notice a significant performance drop due to simple indexes that were previously used, now being ignored by the optimiser. As an example we have nearly identical systems running 10.1.10 and 10.1.26. 10.1.10 is performant, and uses the index correctly, while 10.1.26 is not, and requires a FORCE index to get it to run efficiently. Below are details of the two systems with some (superfluous) information redacted/changed. This has been most noticeable on tables we have that have many 100's of millions of rows (up to 700 million), but may have affected smaller ones as well, just that it hasn't been as obvious an issue. Note that this issue may have affected releases between 10.1.10 and 10.1.26, we can only confirm it as being at least in 10.1.26. The only 'smoking gun' I can point to possibly at this stage is that the TABLE_ROWS and AVG_ROW_LENGTH data aren't updated on the system with the newer server version, which could point to a data issue after upgrading, however I understand that these stats aren't always correct. Prior to upgrade, this database was performant, but I don't have information as to whether these values were reporting correctly or not. FWIW, we have seen this data not up to dat Please let me know if you need any more information. Note that this was one example of this, there was another database with completely different table and data, but with 100s of millions of rows that became similarly inefficient after upgrade, but we don't have the relative detail available for that one like for this example. Latest 10.1.26 release with regression : (db_a)
System that is OK with older version of MariaDB : (db_b)
Below command is running a DESCRIBE on simple query of form "describe select * from big_table where char_id in ('abc','def','gef'...... approx 20,000 entries.....)".
Note that for only a handful of items in the IN (eg. 5) it uses the index correctly in both cases. It is however orders of magnitude more efficient to force the index with the larger IN clause. We didn't let the one not using the index run to completion as it was taking far too long, and consuming significant db resources, but it was verified multiple times before forcing the index usage which worked around the problem. The one that uses the index properly returns in seconds. Table schema, identical on both except for AUTO_INCREMENT, some field names changed :
Schema information from both databases for this table. Note that the stats on the disfunctional db here aren't updated :
Explicit table row information for both :
|
| Comments |
| Comment by Alex [ 2018-01-12 ] |
|
Have the same problem. |