Increase MAX_INDEX on a table

Hi All,

Our devs just reported experiencing adding index on a table, as it hit the maximum number of indexes ( 64 ). Browsing for a solution, found that i need to recompile.

Since we used percona’s deb repository, i also grabbed the source there: apt-get source percon-server-server

After grabbing the source, i updated the file: CMakeLists.txt and edited the line SET(MAX_INDEXES 64) and change to 255, and build the package using dpkgbuild.

but i encountered this error:

---- make[3]: Entering directory `/usr/local/src/percona-server-5.6-5.6.23-72.1/debug’
In file included from /usr/local/src/ppercona-server-5.6-5.6.23-72.1/sql/sql_select.h:31:0,
from /usr/local/src/percona-server-5.6-5.6.23-72.1/sql/abstract_query_plan.cc:19:
/usr/local/src/percona-server-5.6-5.6.23-72.1/sql/opt_range.h: In member function ‘bool SQL_SELECT::check_quick(THD*, bool, ha_rows)’:
/usr/local/src/percona-server-5.6-5.6.23-72.1/sql/opt_range.h:936:17: error: ‘ALL_BITS’ is not a member of ‘key_map {aka Bitmap<256u>}’
Scanning dependencies of target mysqlcheck

Sorry im not familiar with C/C++ now i’m stuck :frowning: …hope someone can direct me to a solution. TIA.

Nhadie

Hi nhadie;

Unfortunately I cannot help with changing the code, as that is a lot more involved than most people will ever get to. But have you already checked for duplicate indexes? Chances are if you have 64 indexes already, you have at least a few duplicates.

https://www.percona.com/doc/percona-toolkit/2.1/pt-duplicate-key-checker.html

-Scott

Thank you Scott. Will look into that.

Nhadie