我可以增加MySQL innoDB中的最大列数吗? [英] Can I increase maximum number of column in MySQL innoDB?

查看:73
本文介绍了我可以增加MySQL innoDB中的最大列数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个InnoDB表中需要4000列.InnoDB允许1017列.我可以增加这个数字吗?如何?我想在一个表中保存4000个时间序列.参见表时间序列表Evry列保存一个时间序列.列名是其他表的自动递增值.其他表包含时间序列名称和可选数据.

I need 4000 columns in one InnoDB table. InnoDB allows 1017 columns. Can I increase this number? How? I want to save 4000 timeseries in one table. See table timeseries table Evry column saves one timeseries. Column name is other tables auto incremented value. Other tables holds timeseries name and optional datas.

推荐答案

直接回答:否

该怎么做:

如果要跨列显示值数组,请不要.用一个由两部分组成的 PRIMARY KEY (表的PK,加上它是哪个数组元素)制作另一个表.

If you are splaying an array of values across columns, don't. Make another table with a 2-part PRIMARY KEY -- the PK of your table, plus which array element it is.

如果您有很多可选列,请将它们序列化为JSON字符串,然后将其放入单个列中.保持非可选列为真实列.

If you have lots of optional columns, serialize them into a JSON string and put it into a single column. Keep the non-optional columns as real columns.

如果是其他模式,请解释.

If it is some other pattern please explain.

限制列数有多种原因,其中一种原因是不良的架构设计".

There are multiple reasons for having a limit on the number of columns, one reason it "bad schema design".

这篇关于我可以增加MySQL innoDB中的最大列数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆