Details
-
Task
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
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().
Attachments
Issue Links
- blocks
-
MDEV-11633 Make the InnoDB system tablespace optional
- Open
- relates to
-
MDEV-21181 Automatic invisible primary key
- Open
-
MDEV-24001 Implement hidden PK for RBR of no-unique key table
- Open