Thanks Alessandro.
I have tried that query, but my query--without "@rid NOT IN $friends"--is still faster than yours. However, I didn't know you could use LET like that. Thanks a lot. I have also tried using UNWIND before, but for some reason using UNWIND seems to take more time than using EXPAND, which is contrary to what I had expected. <https://lh3.googleusercontent.com/-4sHEMRzufR4/VgUbzUNCziI/AAAAAAAAADE/XR5D3LI65No/s1600/thanks.png> On Friday, September 25, 2015 at 5:58:12 PM UTC+9, [email protected] wrote: > > Hi, > try this query > > select rid, count(rid) as NumberOfMutualFriends from (select > $friends.out('isFriendsWith').@rid as rid > from #11:5 let $friends = out('isFriendsWith') UNWIND rid) > where rid <> "11:5" > group by rid > order by NumberOfMutualFriends desc > > Kind regards, > Alessandro > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
