Bug #98093 Possible to remove the restriction that InnoDB autoinc field must have index
Submitted: 30 Dec 2019 3:46 Modified: 30 Dec 2019 5:09
Reporter: Fungo Wang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:8.0.18 OS:Any
Assigned to: CPU Architecture:Any
Tags: autoinc, INDEX

[30 Dec 2019 3:46] Fungo Wang
Description:
In doc AUTO_INCREMENT Handling https://dev.mysql.com/doc/refman/8.0/en/innodb-auto-increment-handling.html

"To use the AUTO_INCREMENT mechanism with an InnoDB table, an AUTO_INCREMENT column must be defined as part of an index such that it is possible to perform the equivalent of an indexed SELECT MAX(ai_col) lookup on the table to obtain the maximum column value. Typically, this is achieved by making the column the first column of some table index."

As we have persisted autoinc in 8.0 by https://dev.mysql.com/worklog/task/?id=6204, so normally there is no need to perform SELECT MAX() on autoinc table created in 8.0.

So can we remove this restriction?

How to repeat:
This is a feature request, check desc.
[30 Dec 2019 5:09] MySQL Verification Team
Hello Fungo Wang,

Thank you for the report and feature request!

Regards,
Umesh