A taxonomy has a lot of big fields attached, but one of these fields is a short text field called
In code, I need to obtain an array mapping
tids for a given list of external identifiers.
So in raw SQL this is very efficient:
SELECT entity_id, field_external_identifier_value FROM field_data_field_external_identifier WHERE field_external_identifier_value IN ('a123','b567',...);
I understand I should be using EntityFieldQuery, but this only gives me an array of
tids, keyed by ...
tid. Then if I loop those and call entity_load it will be doing lots of separate lookups and loading a whole load of stuff I don't need. This looks really inefficient.
I understand that EntityFieldQuery will only return Ids, so is there a better way?
Or do I just resort to SQL?