I am using this query to extract products similar to a product in a certain category within a price range and it is taking a lot of time.
where tofloat(p.Price)>0.5tofloat(p1.Price) and tofloat(p.Price)<2tofloat(p1.Price)
with p1, collect(p)[..3] as products
return p1.ProductId, [product in products | product.ProductId] as pid
There are 87000 product nodes and 219 category nodes. With a limit 0f 5000, it is taking around 8 minutes to return.
Here is the explain plan for the query:
I have already created required indexes while creating the Graph DB itself. Snippet for the same is below: