Home > other >  how to use MySQL key_len in explain statement to defined whether a sql is fast or not?
how to use MySQL key_len in explain statement to defined whether a sql is fast or not?

Time:11-26

The key_len column indicates the length of the key that MySQL decided to use.

MySQL's docs mantion this. but i don't figure out how to use this statement to defined a sql is fast or not. the smaller key_len, the faster sql it is(please forgive my english grammarT_T)? and how it works?

expect for your answer.

CodePudding user response:

This parameter makes sense for composite keys only. The server may use either the whole index completely or some prefix of it only. And key_len allows to define what prefix part of composite index is used.

DEMO

  • Related