← Back to team overview

maria-developers team mailing list archive

Re: How to change max key length for MyISAM?

 

Hi, Witold!

On Jan 14, Witold Filipczyk wrote:
> Sorry, for private question, but I did not know where to ask.
> mariadb-10.3.27.
> 
> I changed in include/myisam.h:
> 
> #define MI_MAX_KEY_LENGTH           3072            /* Max length in bytes */
> 
> but, it did not help, still this ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes.
> 
> What more to change to get key length 3072 for MyISAM tables?

Change HA_MAX_KEY_LENGTH. MI_MAX_KEY_LENGTH is only used for temporary
tables.

> And what can be negative impact of such a change?

More memory on the stack, so if you have a table with lots and lots of
rows, searching for long keys is more likely to cause overflow the
stack. Might be slower, perhaps, as it'll need to copy more data.
It's all "might", may be there will be no negative impact at all.

Why do you want to increase the max key length?

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx


Follow ups

References