MySQL一个索引最多有多少个列

MySQL一个索引最多有多少个列,第1张

MySQL一个索引最多有多少个列?

最多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 specifiedmax 16 parts allowed

mysql>

oracle最大支持1024个列。

而mysql好像更大一些 4.X好像支持2K多列

而且mysql支持多少列与 *** 作系统有关。

win32对大文件的支持没有linux好 我以前弄别的项目也存在这个大文件支持的风险。 所以用linux系统

这也是为什么服务器大多数是unix/linux系统的原因之一。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7333997.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存