[orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-26 Thread Simon L
Hmm.. I'm surprised there isn't a more optimal way of doing this. There should be retrieval limits in the fetchPlan, since often there could be thousands of connected edges. I'm guessing that our best bet is a SELECT with LET? Luca, any thoughts? On Sunday, November 23, 2014 11:10:24 AM UTC-5, S

Re: [orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-25 Thread Luigi Dell'Aquila
well, it depends on how your data are linked together. I mean, if you have this -> Comment Post -> Comment -> Comment -> Comment -> Comment a traverse will not work. On the other hand, if you have Post -> Comment -> Comment -> Comment -> Co

Re: [orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-25 Thread Simon L
Would that be more efficient than a TRAVERSE statement? On Tuesday, November 25, 2014 10:57:24 AM UTC-5, Luigi Dell'Aquila wrote: > > Hi Simon, > > my mistake, I was not clear at all, the sort() function is not a built-in > function, my proposal was to implement your own function called sort() i

Re: [orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-25 Thread Luigi Dell'Aquila
Hi Simon, my mistake, I was not clear at all, the sort() function is not a built-in function, my proposal was to implement your own function called sort() in javascript and use it in the query Luigi 2014-11-25 16:55 GMT+01:00 Simon L : > Thanks for the reply. > > I cannot find any documentatio

[orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-25 Thread Simon L
Thanks for the reply. I cannot find any documentation on the `sort()` function. It did not seem to work on my 2.0 version of the database. Also, does this function properly support large datasets? Again, there could theoretically be 10,000 comments. Version text: `OrientDB Server v2.0-SNAPSHOT

[orientdb] Re: Limit the # of traversed objects returned: fetchPlan VS traverse VS select?

2014-11-25 Thread Luigi Dell'Aquila
Hi Simon, you can do something like this select set($comments[0], $comments[1], $comments[2]) from SOME_POST_ID let $comments = sort(out('PostHasComment')) or but edges are not guaranteed to be sorted, so you have to write your own sort() function. If you are using M3 or earlier, function ex