Pascal KREZEL
Pascal KREZEL

Reputation: 61

Neo4j: How to use APOC apoc.algo.cover procedure?

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

Answers (1)

Bruno Peres
Bruno Peres

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

Related Questions