MySQL中UNIQUE
索引的最大大小是否存在限制?我在我的索引中有六个维度,导致索引非常庞大。 UNIQUE
索引是否存在基数限制?
我遇到了奇怪的未解释错误,想知道是否存在来自UNIQUE
的限制。这可能是由于唯一性限制引起的吗?以下是它的样子(我也不明白为什么最后三列的基数没有增加)。
+-------+------------+----------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| table | 0 | PRIMARY | 1 | column_1 | A | 15 | NULL | NULL | | BTREE | | |
| table | 0 | PRIMARY | 2 | column_2 | A | 91948 | NULL | NULL | | BTREE | | |
| table | 0 | PRIMARY | 3 | column_3 | A | 924889 | NULL | NULL | | BTREE | | |
| table | 0 | PRIMARY | 4 | column_4 | A | 15723114 | NULL | NULL | | BTREE | | |
| table | 0 | PRIMARY | 5 | column_5 | A | 15723114 | NULL | NULL | | BTREE | | |
| table | 0 | PRIMARY | 6 | column_6 | A | 15723114 | NULL | NULL | | BTREE | | |
+-------+------------+----------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
INT
,TINYINT
或FLOAT
,因此我与@svidgen解释的限制相距甚远。 - Mad Echet