>>>>> "tony" == tony <tony@stripped> writes:
>> This is the main reason why it's slow; The current MySQL can't yet
>> optimize queries where columns are stored differently.
tony> How 'different' do the tables have to be?
tony> is customerid mediumint(9) different from customerid mediumint(8)?
tony> or itemid varchar(13) different from itemid char(13)?
The key word is 'stored'. In other words; It's is not depending on
the display length.
For example:
In the following cases keys will be used:
col1 col2
mediumint(x) mediumint(y)
CHAR(x) VARCHAR(x)
double(x,y) double(x1,y2)
In the following cases keys will not be used:
col1 col2
int(x) mediumint(y)
CHAR(x) VARCHAR(y) (where x != y)
Regards,
Monty
PS: This will be fixed in MySQL 3.23.x at the same time we add support
for NULL in keys and keys on BLOBs.