简体   繁体   English

如果引擎是InnoDB / MYISAM,我们可以在mysql表中添加几列?

[英]how many columns we can add in mysql table if engine is InnoDB/MYISAM?

If we have used InnoDB engine in mysql table, how many columns add in one table ? 如果我们在mysql表中使用了InnoDB引擎,则在一个表中添加多少列? And if we have used MyISAM engine, how many columns we can add in one table? 如果我们使用了MyISAM引擎,我们可以在一个表中添加多少列? Please tell me also, how many rows we can created in both InnoDB and MyISAM engine? 还请告诉我,我们可以在InnoDB和MyISAM引擎中创建多少行?

According to the MySQL Reference Manual, there is a hard limit of 4,096 columns per table. 根据MySQL参考手册,每个表有4,096列的硬限制。

Check the following link for more information. 检查以下链接以获取更多信息。

Columns per table < 1000 (1017 in 5.6.9, InnoDB); 每个表中的列<1000(5.6.9中的1017,InnoDB); 2598(?) for MyISAM. MyISAM的2598(?)。 I think the 4096 limit is at the Handler level; 我认为4096的限制是在Handler级别; the Engines tend to be stricter. 引擎往往更严格。

But... having more than a couple hundred columns in one table is usually "bad schema design". 但是...在一个表中有几百列通常是“不良的架构设计”。 Explain what you are after; 解释你所追求的; we can help you re-design your schema. 我们可以帮助您重新设计架构。

Number of rows... There is no limit on number of rows, only table size: 行数...行数没有限制,只有表格大小:

  • 64TB per InnoDB tablespace (ibdata1 or .ibd). 每个InnoDB表空间(ibdata1或.ibd)为64TB。 Hence, a non-PARTITIONed table is limited to 64TB of data + indexes. 因此,非PARTITIONed表被限制为64TB的数据+索引。 A PARTITIONed table has one tablespace per PARTITION. 一个分区表每个分区有一个表空间。 With the non-default innodb_page_size=65536 (5.7.x), 256TB. 非默认innodb_page_size = 65536(5.7.x),256TB。
  • Default limit on MyISAM table size of 2^48 (256TB) bytes. MyISAM表大小的默认限制为2 ^ 48(256TB)字节。 Hard limit of 2^56 bytes for a table. 表格的硬限制为2 ^ 56字节。 (See myisam_data_pointer_size and CREATE TABLE ) (请参见myisam_data_pointer_sizeCREATE TABLE

See also More Limits . 另请参阅更多限制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM