Hi Davide,
Looks like a bug. Could you provide a dataset where I can test expand issue.
Meanwhile, you can try to use following workaround:
SELECT expand() FROM (SELECT intersect(out('friends').@rid) FROM [#11:589,
#11:48780])
As for performance of your last query, you shouldn't be worried, such case
is optimized to prevent full scan.
I don't fully understand the performance hit. Is an index on @rid necessary?
rid is like a direct link to your record, you don't need to index it.
Best regards,
Artem Orobets
* Orient Technologiesthe Company behind OrientDB*
2014-04-07 10:33 GMT+03:00 Davide Marquês <[email protected]>:
> 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.
>
--
---
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.