Closed jbadger3 closed 6 years ago
Perhaps you can name the index idx_drug_exp__type_id
? I think "type_id" is better than dtc_id
because "drug" is redundant in this content and so is "concept". (All of the IDs in all the tables are concept IDs except for the patient and record IDs and those are never foreign keys.) That leaves type_id
. Now that could mean either "drug type ID" or "drug exposure type ID", but I think those are effectively the same for our purposes.
Good point. I have updated the current pull request to reflect the recommended change.
Accepted and merged.
I added drug_type_concept_id to the list of indexes for the drug_exposure table. The field is useful for determining the origin of a drug exposure as 'prescription written', 'medication list entry', etc. I have been running queries using this field as a filter and am running into long execution times. I'm hoping addition of this index will help speed things up a bit.