This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

Maximum columns per index

I have a question about the maximum columns per index.

In the MariaDB documention I have noticed that the maximum columns per index is 16: https://mariadb.com/kb/en/mariadb/myisam-overview/

This is aligned with the comment it has on the code: https://github.com/MariaDB/server/blob/5.5/sql/item_subselect.cc#L4354

In contradict to the above, the code shows a different value for this 'define' (#define MAX_REF_PARTS 32): https://github.com/MariaDB/server/blob/5.5/sql/sql_const.h#L33

MariaDB was forked from mysql 5.5 (to my knowledge), in which, this 'define' was indeed 16: https://github.com/twitter/mysql/blob/master/sql/sql_const.h#L33

To me it seems like the code has changed, but documentation & comment are outdated. Is this correct or am I missing something regarding this value?

Best regards, Maya

Answer Answered by Ian Gilfillan in this comment.

Thanks, you are correct, this limit was changed (in 2010!). The docs have been updated, and the comment in the code will be shortly.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.