I have a table with a dual primary key (impression_id, element_id). Are those fields indexed? Individually or as a combo index? In addition to using the impression_id field in a join, I need to access element_id in the where clause of a big query. Would it offer any benefit at all to index element_id independently?
I believe they are indexed as a dual unit, thus as index(impression_id,element_id). And in answer to your question : I'm not 100% but I believe that yes, you will benefit from indexing only element_id as your where clause should use this index properly. Use EXPLAIN to find out where your indexes are being used in your queries. The path execution planner however might work out that as (impression_id,element_id) is a primary key and therefore unique it CAN use that to limit with your where clause.