Terence wrote:
Hi List,
When using EXPLAIN, the key length on an integer column is stated as 4. However the column is running into 7 digits, and that's affecting our performance. Anyway to increase the key length?
From the manual I have found that it can be done for varchar cols.
Thanks for any help.
key_len is given in bytes, not characters (though they are often the same thing for varchars). An INTEGER is 4 *bytes*, not digits, with a range of -2147483648 to 2147483647. In other words, a key_len of 4 is correct for an INTEGER column, and a 7 digit number easily fits in 4 bytes.
If your performance is suffering, then, this isn't the reason. If you'd like help with your performance, you'll need to post your query and the explain output. SHOW CREATE TABLE for the relevant tables may also be helpful.
Michael
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]