I have a cypher query which return collection of data depending on other relationships but the query takes long time compared with other queries
Here is my query
MATCH (current_p:Photographer) WHERE current_p.nodeId = 791
MATCH (t:Tag)<-[r:INTERESTS_IN]-(other_p:Photographer)-[:UPLOADS]->(i:Photo)
WHERE t.nodeId IN [994,992,990,993,988,991,989,256,54,10370,810,61,517,279,423,13240,13244,13241,13239,13245]
AND other_p.nodeId <> 791 AND i.deleted_at is null
OPTIONAL MATCH (current_p)-[r_follow:FOLLOWS]->(other_p)
WITH DISTINCT other_p, r, i, r_follow
ORDER BY r.last_hitting_time DESC, r.weight DESC, other_p.nodeId
RETURN DISTINCT other_p, COLLECT(DISTINCT(i))[..4] as photos, r_follow
SKIP 0 LIMIT 3
And the array of Ids is have different ids for each user
If any problem in the query pls tell me how to enhance it