Why can't the auto_random column be used as the first column in a composite index?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 为什么auto_random列不能用作联合索引的第一列呢?

| username: TiDBer_D7483dYr

【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】
【Reproduction Path】What operations were performed that caused the issue
【Encountered Issue: Issue Phenomenon and Impact】
【Resource Configuration】
【Attachments: Screenshots / Logs / Monitoring】

The AUTO_INCREMENT column can be used as the first column of a composite index, so it can also be used in partitioned table scenarios.
AUTO_RANDOM cannot be used in partitioned tables due to this limitation.
There shouldn’t be much difference in principle between the two.

| username: yiduoyunQ | Original post link

Fixed in ddl: allow defining auto_random on composite primary key · Issue #38572 · pingcap/tidb · GitHub