Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATCH doesn't work with record id #7724

Closed
bbourgois opened this issue Sep 6, 2017 · 3 comments
Closed

MATCH doesn't work with record id #7724

bbourgois opened this issue Sep 6, 2017 · 3 comments
Assignees
Labels

Comments

@bbourgois
Copy link

OrientDB Version: 2.2.26

Java Version: 7

OS: WINDOWS

Actual behavior

We have this model :
Unit <- Person(pds) -> profession
(246515 vertex) <- (661491 V) -> (68 V)
A Unit is linked to less than 5 person.

We want to find the person for a specialty and a profession. For both, we have the id.

This request is very slow (7 seconds) :
MATCH
{class:pds, as:pds}.out('has_punit'){class:unit, where : (@Rid = #104:11482)},
{as:pds}.out('has_pprofession'){class:profession, where : (@Rid = #81:0)}
RETURN pds

In the documentation : change this: select from Profile where @Rid = #10:44 with this: select from #10:44

Question

Is it possible to use record ID as target in a Match query ?

@luigidellaquila
Copy link
Member

Hi @bbourgois

Yes, instead of

MATCH {class:pds, as:pds, where:(@Rid = #104:11482)}...

you can use

MATCH {rid:#104:11482, as:pds}...

We introduced it as an experimental feature, so it's not documented yet, but it works definitely fine

Thanks

Luigi

@KishoDai
Copy link

KishoDai commented Sep 7, 2017

Hi @luigidellaquila
The feature is so cool.
Is it more faster than query by where condition?

@lvca
Copy link
Member

lvca commented Sep 7, 2017

It's much faster. It's O(1), no matter the database size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants