Steve,
I have, to no avail. But, having some time to spare today, I started doing more searching on this and found the problem - I just have no idea how to fix it. I'm not an expert in MySQL, but I have been doing DBA stuff for a long time on MySQL/PostgreSQL/MSSQL - so I wouldn't think an index issue would be terribly hard for me to figure out.. but I sure am stumped here.
I have two different Sugar DBs (as mentioned before) on a new MySQL install (5.0.24 - Windows). One of the DBs comes from a Linux install of Sugar 4.2 (MySQL 4.1.14) which I moved to the Windows instance and then upgraded to Sugar 4.5. The other DB was a new creation with Sugar 4.5 (was that clear? Two DBs, both on Windows 5.0.24, one was new, one was an upgrade from MySQL 4.1.14 and Sugar 4.2)... anyway.
On the DB that we've been using for almost a year (the one moved form the linux box/MySQL 4.1.14), an explain on the statement I previously mentioned yeilds:
HTML Code:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE accounts ref idx_accnt_assigned_del idx_accnt_assigned_del 112 const,const 1 Using where
1 SIMPLE accounts_cstm ref PRIMARY PRIMARY 110 gss_sugarcrm.accounts.id 1 Using index
HOWEVER, on the DB that was created from scratch on this Windows MySQL server, using SugarCRM setup, the same EXPLAIN statement produces unforunate results!
HTML Code:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE accounts ALL idx_accnt_assigned_del NULL NULL NULL 4757 Using where
1 SIMPLE accounts_cstm index PRIMARY 38 NULL NULL 8689 Using index
How could this be? I've racket my brain over and over, played with the indexes and all to no avail. This definitely explains why the a simple "count" statement is taking so long to execute, it's building millions of rows for the query. Does anyone have any ideas what could be going on here? How can the same two tables in two different DBs with the same indexes give completely different results.
I'd love to hear from anyone that might have suggestions.
Thanks!
Ryan
Bookmarks