Open jacksund opened 2 years ago
Note, indexes from mix-ins won't be inherited automatically. We'll have to combine them manually. See here
Alternatively, I can also set db_index=True
to the fields which will be inherited properly. See here
I now use db indexes all the time with small molecules (via db_index=True
), and it's absolutely crucial in tables with >1million rows. Brings queries from >10s down to <0.1s in a bunch of cases.
So I'm surprised we haven't done this already for some core tables -- especially WorkItem
and workflow tables involved in evolutionary search. tags
, chemical_system
, and other columns will definitely need them
@SWeav02 for future reference
Common queries -- such as searching
chemical_system__in
on theCodStructure
-- are extremely slow because there is no database index.Django allows the creation of model indexes using the
Meta.indexes
option. I should explore adding these for common queries -- especially ones on the homepage for Simmate.I've never made indexes before, so this may take some time to implement.