Read trigger get_sample_direct_ancestor() issues the neo4j query defined in get_sample_direct_ancestor()
This trigger only applies to Sample. In the MATCH clause, change (e:Entity) to (e:Sample) will reduce the total number of db hits and unnecessary filtering.
Read trigger get_creation_action_activity() issues the neo4j query defined in get_entity_creation_action_activity()
This trigger only applies to Dataset. In the MATCH clause, by specifying ds:Dataset label we'll reduce the total number of db hits and unnecessary filtering.
After analyzing the two profiling results from https://github.com/hubmapconsortium/entity-api/issues/641, I identified two read triggers that can benefit from some very simple neo4j query tuning.
Read trigger
get_sample_direct_ancestor()
issues the neo4j query defined inget_sample_direct_ancestor()
This trigger only applies to Sample. In the
MATCH
clause, change(e:Entity)
to(e:Sample)
will reduce the total number of db hits and unnecessary filtering.Read trigger
get_creation_action_activity()
issues the neo4j query defined inget_entity_creation_action_activity()
This trigger only applies to Dataset. In the
MATCH
clause, by specifyingds:Dataset
label we'll reduce the total number of db hits and unnecessary filtering.