EXPLAIN shows only key length.
For example:
We have an complex index on a table.
IDX_KEY (col1, col2, col3) (let's all the columns are integer type)
if the key length (from "explain" output) = 4 then only the col1 of IDX_KEY index is used in the query.
if 8 then col1 and col2.
if 12 then all the columns in the index are used.
My question: is there a way to determine columns list without calculations?
UPD:
The real table has a lot of fields and indexes. But for example, let it has such definition: CREATE TABLE `tbl` (`col1` unsigned int not null,`col2` unsigned int not null,`col3` unsigned int not null, primary key (`col1`,`col2`,`col2`));
Then the explain can be like this (in case of using only one column from the index):
"id" "select_type" "table" "type" "possible_keys" "key" "key_len" "ref" "rows" "Extra"
"1" "PRIMARY" "tbl" "range" "PRIMARY" "PRIMARY" "4" \N "1" ""