Sunil Kumar Singh
Sunil Kumar Singh

Reputation: 11

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?

Upvotes: 1

Views: 275

Answers (2)

Rick James
Rick James

Reputation: 142218

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.

Upvotes: 1

apurav gaur
apurav gaur

Reputation: 342

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

Check the following link for more information.

Upvotes: 1

Related Questions