最多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>
MySQL一个索引最多有多少个列?真实的测试例子
2019-10-30 17:37mysql教程网 Mysql
MySQL一个索引最多有多少个列?下面是具体的实现代码。
延伸 · 阅读
- 2019-10-30MySQL里Create Index 能否创建主键 Primary Key
- 2019-10-30使用mysql中遇到的几个问题
- 2019-10-30MySQL: mysql is not running but lock exists 的解决方法
- 2019-10-30mysql "too many connections" 错误 之 mysql解决方法
- 2019-10-30php下将图片以二进制存入mysql数据库中并显示的实
- 2019-10-29在OracleE数据库的字段上建立索引的方法
精彩推荐
- Mysql
CentOS 6、7下mysql 5.7 详细安装教程
这篇文章主要为大家介绍了CentOS 6、7下mysql 5.7 详细安装教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...
- Mysql
MySQL高效导入多个.sql文件方法详解
MySQL有多种方法导入多个.sql文件,常用的有两个命令:mysql和source,如何提高导入速度,在导入大的sql文件时,建议使用mysql命令...
- Mysql
SQL语句执行深入讲解(MySQL架构总览->查询执行流程->SQL解析
这篇文章主要给大家介绍了SQL语句执行的相关内容,文中一步步给大家深入的讲解,包括MySQL架构总览->查询执行流程->SQL解析顺序,需要的朋友可以参考下...
- Mysql
MySQL通过show processlist命令检视性能的讲解
今天小编就为大家分享一篇关于MySQL通过show processlist命令检视性能的讲解,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一...
- Mysql
Mysql服务器的启动与停止(一)
在讨论如何 启动 MySQL 服务器 之前,让我们考虑一下应该以什么用户身份运行MySQL服务器。服务器可以手动或自动启动。如果你手动启动它,服务器以你登...
- Mysql
Mysql my.ini 配置文件详解
Mysql my.ini 配置文件详解 ...
- Mysql
Ubuntu 18.04配置mysql以及配置远程连接的步骤
这篇文章主要给大家介绍了关于Ubuntu 18.04配置mysql以及配置远程连接的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参...
- Mysql
MySql通过ip地址进行访问的方法
这篇文章主要介绍了MySql通过ip地址进行访问的方法,首先要登录mysql,切换数据库然后授权,具体代码详情大家参考下本文...