MySql 5.6, InnoDB. I have a table with 8 million records. It has an integer primary key, and a unique index u1 CHAR(40). It also has a few small fields and a VARCHAR(1000).
SELECT COUNT(*) FROM my_table FORCE INDEX(u1)
takes 1.0 s
SELECT COUNT(*) FROM my_table FORCE INDEX(PRIMARY)
takes 1.2 s
This is on Linux boxen. But on Windows boxen the times are 2 s and 45 s!
The cnf/ini files are roughly the same. Tweaking buffer sizes etc has been unsuccessful so far. There seems to be a big problem with primary key lookups on Windows. Perhaps a bug in InnoDB on Windows? Or what?
EXPLAIN
give different results between the two servers? DoesSHOW VARIABLES
report any differences in version, innodb_version, or optimizer_switch? Do the two servers have substantially different storage architecture or I/O loads?