Hi all,

Looking for help on how to use the intersect operator correctly in a query 
to grab information about mutual friends.
Note: using the latest development branch.

The initial @rid intersection works as expected:
SELECT intersect(out('friends').@rid) FROM [#11:589, #11:48780]
{
    "result": [
        { "@type": "d", "@rid": "#-2:0", "@version": 0, "intersect": [ 
"#11:52266", "#11:52139", ..., "#11:49360" ], "@fieldTypes": "intersect=e" }
    ],
    "notification": "Query executed in 0.062 sec. Returned 1 record(s)"
}

And this is the query I thought would work:
SELECT expand(intersect(out('friends').@rid)) FROM [#11:589, #11:48780]
Unfortunately, it returns no results. Bug? Misuse of expand over intersect?

This one works but at the expense of a full table scan:
SELECT FROM P WHERE @rid IN (SELECT intersect(out('friends').@rid) FROM 
[#11:589, #11:48780])
I don't fully understand the performance hit. Is an index on @rid necessary?

Tips/references to open issues welcome.

Cheers,
Davide

-- 

--- 
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.

Reply via email to