MySQL一个索引最多有多少个列?真实的测试例子

2023年 4月 19日 92.3k 0

最多16列。 create table test ( f1 int, f2 int, f3 int, f4 int, f5 int, f6 int, f7 int, f8 int, f9 int, f10 int, f11 int, f12 int, f13 int, f14 int, f15 int, f16 int, f17 int ); create index idx_test_16 on test (f1,f2,f3,f4,f5,f6,f7,f8,f

最多16列。 create table test ( f1 int, f2 int, f3 int, f4 int, f5 int, f6 int, f7 int, f8 int, f9 int, f10 int, f11 int, f12 int, f13 int, f14 int, f15 int, f16 int, f17 int ); create index idx_test_16 on test (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); create index idx_test_17 on test (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17); 运行结果如下: mysql> create table test ( -> f1 int, -> f2 int, -> f3 int, -> f4 int, -> f5 int, -> f6 int, -> f7 int, -> f8 int, -> f9 int, -> f10 int, -> f11 int, -> f12 int, -> f13 int, -> f14 int, -> f15 int, -> f16 int, -> f17 int -> ); Query OK, 0 rows affected (0.06 sec) mysql> mysql> create index idx_test_16 on test (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16); Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> create index idx_test_17 on test (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17); ERROR 1070 (42000): Too many key parts specified; max 16 parts allowed mysql>

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论