Note that there are some explanatory texts on larger screens.

plurals
  1. PONeo4j, long linked lists, timeouts, - should I use an index instead? (Neo 1.9)
    primarykey
    data
    text
    <p>I'm using a linked list to keep track of a user's activities, but I want to keep track of every activity, not just the last 20 or so.. So over time, a user might have 5000 nodes in the list.. (Neo 1.9, Neography Gem, ROR 3.2...)</p> <p>When I use cypher to traverse the list, it does well as long as the number of hops is under 40 or so... but.. with thousands of nodes, 40 isn't gonna cut it.. If I use a larger number, Neo basically gets tied up for quite some time..</p> <p>The issue is this.. say a user liked a photo a while ago, say 1000 actions ago before the most recent, and for some odd reason they want to unlike a photo.. Well, I have to snip that node out of the activity linked list. Problem is, I have to locate that activity node that is buried 1000 nodes deep.. So the 40 hops that seems to not freeze things up isn't going to work at all</p> <p>When I run the following cypher query, it just takes minutes, if it finishes at all.. (:ACTIVITIES_FIRST_NODE IS the head of the linked list)</p> <pre><code>START viewer_who_liked=node(2675) MATCH viewer_who_liked-[:ACTIVITIES_FIRST_NODE|ACTIVITIES_NEXT_NODE*]-activity_list_node-[:LIKES_PHOTO]-&gt;object RETURN id(activity_list_node) </code></pre> <p>It doesn't freeze up if I change it to [:ACTIVITIES_FIRST_NODE|ACTIVITIES_NEXT_NODE*1..30] but that won't find the node I'm looking for.. And the where function is useless as it seems to be evaluated after the traversal of the activities nodes.. I've used the with clause to no avail.. I also tried step and limiting - no dice.. it always times out...</p> <p>Now, if I use limit and skip it doesn't bomb but it also doesn't return the node I'm looking for unless I plan on iterating through chunks of the list.... but I'm looking for one result, and quickly, and don't want to iterate through sets of records.. (This works fine for an activity feed that is paged, but not looking for a needle in a haystack.. I need the needle in the haystack..)</p> <p>So, I was wondering, should I put the activities nodes on an index (in addition to being on the linked list - the linked list is great for activity feeds etc), and search the index to retrieve the proper activity node, then perform the removal of the target node? Or am I overlooking something here/ doing something wrong..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload