Server performance issues

Hello, I am having weird performance issues on aws c5.xlarge instance. Despite having a relativly small database (904 nodes, 3890 edges), when I execute a query

MATCH (n:PERSON)-[*..6]-(city:GEO {hash: '116'})
RETURN DISTINCT n

I have to wait an extrodinary amount of time to execute it. And the weird part is that the server most of the time has only 1 vCPU on 100% while the other 7 are mostly idle. No issues with memory. I've tried to add config_db.memory.pagecache.warmup.preload = true in neo4j.conf file. But performance is still very poor. It takes minutes to execute this call.

Am I missing something or doing something wrong? Or it is expected behavior from community version of neo4j? I am using 5.4.0 version

Switching to enterprise version will change this?

Using the [:LABEL*] syntax has been very very slow in my experience . I would use a *2 at most. :slight_smile:
-dave

1 Like

also given its a variable length hop of up to 6 hops and with no direction defined it could be simply that the number of n and city returned are exponential

As a test run

MATCH (n:PERSON)-[*..1]-(city:GEO {hash: '116'})
RETURN count(n)

then rerun and go 2 hops and thus

MATCH (n:PERSON)-[*..2]-(city:GEO {hash: '116'})
RETURN count(n)

and now 3 hops

MATCH (n:PERSON)-[*..3]-(city:GEO {hash: '116'})
RETURN count(n)

are the results exponentially expanding.

1 Like

Hello @anton :slight_smile:

You should have a look at apoc.path.expand procedures to achieve your goal.

Best regards,
Cobra

1 Like

Hello, thank you, I will look into this