简体   繁体   中英

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 ? And if we have used MyISAM engine, how many columns we can add in one table? Please tell me also, how many rows we can created in both InnoDB and MyISAM engine?

According to the MySQL Reference Manual, there is a hard limit of 4,096 columns per table.

Check the following link for more information.

Columns per table < 1000 (1017 in 5.6.9, InnoDB); 2598(?) for MyISAM. I think the 4096 limit is at the Handler level; 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). Hence, a non-PARTITIONed table is limited to 64TB of data + indexes. A PARTITIONed table has one tablespace per PARTITION. With the non-default innodb_page_size=65536 (5.7.x), 256TB.
  • Default limit on MyISAM table size of 2^48 (256TB) bytes. Hard limit of 2^56 bytes for a table. (See myisam_data_pointer_size and CREATE TABLE )

See also More Limits .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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