Re: multi column index and used key_len

2004-04-16 Thread Herald van der Breggen
Two small corrections: ad point 1. "b in ('2004-05-01')" behaves different from "b = '2004-05-01'". The last one is better: key_len = 6, instead of 3. mysql> explain select count(*) from A, B where A.a=B.a and b ='2004-05-01'; +---+---+---+-+-+---+

multi column index and used key_len

2004-04-16 Thread Herald van der Breggen
Hello, I reached a point I can't go any further with forcing mysql to use the index as much as needed. I am facing a multi column index of which only the first column is used. Let me explain... This works fine: create table A ( a mediumint not null, b date not null, index (a,b)); Populate the