Hello there, i need recommendations about Cypher queries.
Honestly, dont know how to make it better, but it still awfully slow.
Full text of query:
With production database, full API request executes near of 3 seconds. And i can't figure out where exactly the problem: the query, the method of connection on backend level or even database setup (maybe i should optimize database itself?)
I don't know where exactly the problem: the query itself, the database setup or even backend connection method. Any tips will be useful.
Maybe i should split this big query on the smaller and async ones?
Maybe you could replace OPTIONAL MATCH with pattern comprehension or subqueries. I also see an OPTIONAL MATCH with an infinite depth, you could use apoc.path.expandConfig() since you are on Neo4j 4.4 (with Neo4j 5.9, you could use quantified path patterns). Infinite depth can cause performance issue especially if there are densely connected nodes.
My goal is to show part of the nodes related with Catalog Node - content, domains, skills etc.
Thanks for advices, gonna try them and reply here about results.
Unfortunately, even very-very simple case of query working very slow, i am literally have no idea why it happens. Example:
1.2 seconds for requesting 2 nodes and retrieving one of them. After script restart, it goes from 1.2 to 0.02, but it's because of the cache, so doesn't count.
Why it happens? Where am i mistaken - the query, the python implementation? Should i switch something in database settings?