[MDEV-19506] Remove the global sequence DICT_HDR_ROW_ID for DB_ROW_ID Created: 2019-05-17  Updated: 2023-03-21  Resolved: 2023-01-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 11.0.1

Type: Task Priority: Blocker
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: Preview_11.0, performance

Issue Links:
Blocks
blocks MDEV-11633 Make the InnoDB system tablespace opt... Open
Relates
relates to MDEV-21181 Automatic invisible primary key Open
relates to MDEV-24001 Implement hidden PK for RBR of no-uni... Open

 Description   

InnoDB tables that lack a primary key (and any UNIQUE INDEX whose all columns are NOT NULL) will use an internally generated index, called GEN_CLUST_INDEX(DB_ROW_ID) in the InnoDB data dictionary, and hidden from the SQL layer.

The 48-bit DB_ROW_ID is being assigned from a global sequence that is persisted in the DICT_HDR page.

There is absolutely no reason for the DB_ROW_ID to be globally unique across all InnoDB tables. We should replace dict_sys_get_new_row_id() with a simple atomic increment of a counter in dict_table_t. When the table is opened for the first time, btr_cur_instant_init_low() can initialize the per-table counter by doing something similar to row_search_max_autoinc().



 Comments   
Comment by Marko Mäkelä [ 2022-12-09 ]

The per-table DB_ROW_ID counter will be restored in btr_cur_instant_init() and row_import_cleanup(). A downgrade to earlier server versions will be prevented by MDEV-29694/MDEV-30106.

Comment by Matthias Leich [ 2022-12-13 ]

origin/bb-10.11-new-innodb-defaults c434f870a346fb11a6b5932dbdf860ed7e2d2f74 2022-12-12T10:05:22+02:00
which contains MDEV-29986, MDEV-19506, MDEV-29694, MDEV-30136, MDEV-29983
performed well in RQG testing. No new problems

Generated at Thu Feb 08 08:52:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.