Reputation: 61
Hi,
I try to use the "cover" function from APOC like this :
WITH ["f1,"f2",...] as list1
MATCH (n:Frag)
WHERE n.frag in list1
WITH COLLECT(ID(n)) as nodeIds
CALL apoc.algo.cover(nodeIds)
YIELD rel
RETURN rel
It works but it is very slow the first time. If I do it once again, it becomes muck quicker! What does that mean?
Upvotes: 1
Views: 442
Reputation: 16373
Probably your issue is not related to apoc.algo.cover
usage, but to the WHERE
part of your query. You can try a performance improvement adding an index in the Frag.frag
property.
CREATE INDEX ON :Frag(frag)
After creating the index run your query again. Note that the index is not immediately available, but will be created in the background.
Upvotes: 1