I've got a slow MySQL SELECT query, that I can't seem to troubleshoot.
It's a simple one, on a table with about 600,000 records.
SELECT *
FROM `civicrm_contact` contact
WHERE contact.external_identifier =123456
The Select query takes anywhere between 3-6 seconds, which make importing another 600,000 records that depend on this query, completely impractical.
The table indexes are shown in attached image:
If I search based on contact.id=123456 then the query time is down to about 0.004s. contact.id is the primary key on the table. external_identifier is a unique index.