1

There is cypher sql like this:

match p=(:Devices{name:"123.123.123.123"})-[r:Cost*..6]->(:Devices{name:"123.123.123.124"}) with p return p;

Then it's return:

{u'p': (123.123.123.123)-[:Cost {Cost: 21}]->(123.123.123.120)-[:Cost {Cost: 92}]->(123.123.123.110)-[:Cost {Cost: 82}]->(123.123.123.119)-[:Cost {Cost: 91}]->(123.123.123.123)-[:Cost {Cost: 56}]->(123.123.123.130)-[:Cost {Cost: 24}]->(123.123.123.124)}

There is a ring in my path and how to avoid this condition.

Finally why my query is so solw and query a path under in 10 depth will spend about 1000s-2500s.

There is my config:

dbms.memory.heap.initial_size=4096m
dbms.memory.heap.max_size=9192m
dbms.memory.pagecache.size=10g
dbms.threads.worker_count=16
user8608946
  • 79
  • 1
  • 1
  • 6

1 Answers1

0

Perhaps you meant to specify a path of between 1 and 6 hops, rather than exactly six:

match p=(:Devices{name:"123.123.123.123"})-[r:Cost*1..6]->
  (:Devices{name:"123.123.123.124"}) with p return p;
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
  • Thanks,but there also will spend many time in select path and get result.How to let select be fastly? – user8608946 Dec 31 '18 at 05:43
  • Could you rephrase your question please? I did not understand the meaning. Do you mean you want the query to return faster? Is there an index on `:Device` name property? – Jasper Blues Dec 31 '18 at 07:57
  • Yes,I want the query to return faster.Now I query a path will spend about 1000s if the max hops is 10。 – user8608946 Jan 01 '19 at 03:23
  • One specific question at a time please. If the first answer solved your initial question, can you accept the answer, an open a new question with regards to increasing performance. Post a link in the comment. – Jasper Blues Jan 01 '19 at 03:25
  • Ok,thanks for your suggestions!I meant a path every node only have one and avoid the ring.Doest't like this: {u'p': (123.123.123.123)-[:Cost {Cost: 21}]->(123.123.123.120)-[:Cost {Cost: 92}]->(123.123.123.123)-> – user8608946 Jan 02 '19 at 01:55