[MDEV-31589] Secondary index MVCC access is unnecessarily inefficient Created: 2023-06-30  Updated: 2024-01-21

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.6, 10.11, 11.0, 11.1, 11.2

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Vladislav Lesin
Resolution: Unresolved Votes: 1
Labels: performance

Issue Links:
Relates
relates to MDEV-32286 ANALYZE displays a huge number of Inn... Confirmed
relates to MDEV-17598 InnoDB index option for per-record tr... Open
relates to MDEV-20301 InnoDB's MVCC has O(N^2) behaviors Closed
relates to MDEV-31558 Add InnoDB engine information to the ... Closed

 Description   

As noted in MDEV-31558, a covering secondary index read in InnoDB would look up the clustered index record twice and retrieve the matching version. In the test innodb.mvcc_secondary we have a table with 2 versions of 1 row, and the first SELECT statement would construct the old version of the clustered index not once, but twice.

MDEV-20301 replaced row_sel_get_clust_rec_for_mysql() with Row_sel_get_clust_rec_for_mysql::operator(), which adds some caching. It missed an opportunity to remove the call row_sel_sec_rec_is_for_clust_rec() and to perform those checks as part of the loop that invokes row_sel_build_prev_vers_for_mysql().


Generated at Thu Feb 08 10:25:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.