i have a tabled called aux_counties which lists the 2 digit state code and the county name in separate columns. for this table, the primary key is the combination of the two of them. Yet this query of about 3200 counties is VERY SLOW (like 1.9 seconds):
SELECT co_state,co_name,StateID,CountyID FROM aux_counties ORDER BY co_state, co_name
so I deleted the primary key, and just simply INDEXED co_state and co_name - and guess what, the same query took .04 seconds.
Why? I would think a primary key would be fast, even if it is involving 2 columns - but it is not and that is not the only time I have noticed this.
I hate having duplicate indexes on the same field. Any suggestions on how to do this the very best practice/way? Thanks!