Foreword: How many indexes can be created on a mysql table on the Internet? Basically, there are two answers, one is unlimited, the other is 16 columns, I think the origin of 16 should be uploaded on the Internet to twist, because mysql A single index can include up to 16 columns, but this is the answer to how many columns an index contains, not how many indexes can be built. It is really misleading! For this reason, I have a good meal and finally found the authoritative answer on the official website. Now I will summarize some of the limitations of the mysql table. I hope to help friends who are confused about this. If it is useful, I will like it~_~
Because some of the limitations of mysql are related to specific storage engines, only our most commonly used innoDB and myisam are listed below.The specific limitations of other storage engines can be found on the official website.
- innoDB: Create up to 1017 columns, up to 64 secondary indexes, a single index contains up to 16 columns, and the maximum length of the index is 767 bytes. Up to 3072 bytes), the maximum row size is 65536 bytes
- mysiam: up to 4096 columns, up to 64 secondary indexes, a single index contains up to 16 columns, the maximum length of the index is 1000 bytes, and the maximum row size is 65536 bytes
The above are all sorted out from the official mysql documentation, if you are interested, you can go and see for yourself
- The official documentation of innoDB limits: https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html
- Official documentation of myisam restrictions: https://dev.mysql.com/doc/refman/8.0/en/myisam-storage-engine.html
From my blog: http://blog.nice100.net/mysql/14.html