Skip to content

Commit

Permalink
fetch_synapse_connections(): Use DISTINCT to optimize query
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarteberg committed Nov 30, 2021
1 parent 0af314f commit 8a7993d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neuprint/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,9 @@ def _fetch_synapse_connections(source_criteria, target_criteria, synapse_criteri
{combined_conditions}
WITH n, m, ns, ms, e
// Note: Semantically, the word 'DISTINCT' is unnecessary here,
// but its presence makes this query run 10x faster.
WITH DISTINCT n, m, ns, ms, e
WHERE e.weight >= {min_total_weight}
{source_syn_crit.condition('n', 'm', 'ns', 'ms', prefix=8)}
Expand Down

0 comments on commit 8a7993d

Please sign in to comment.