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

mid traversals not using available index #141

Open
misu200 opened this issue Feb 3, 2018 · 5 comments
Open

mid traversals not using available index #141

misu200 opened this issue Feb 3, 2018 · 5 comments
Assignees

Comments

@misu200
Copy link

misu200 commented Feb 3, 2018

I am using OrientDB 3 RC1 (Gremlin+TInkerpop 3 community edition)

In the Tinkerpop 3 ref docs it says:
"Whether a mid-traversal V() uses an index or not, depends on a) whether suitable index exists and b) if the particular graph system provider implemented this functionality."

It seems OrientDB gremlin not implemented yet this functionality so for the following kind of query even if I have a UNIQUE_HASH_INDEX index on 'adresa' field from Adresa class..it will not be hit:

g.V().hasLabel("Firma").as("a").
V().hasLabel("Adresa").as("b").
where("a", eq("b")).by("adresa").
addE("Location").from("a").to("b")

Should I expect for this to work when OrientDB will be released for production use?
Or maybe should I try rewrite the query in some other way? ....or just use the OrientDB SQL?

Thanks,
Mihai

@misu200
Copy link
Author

misu200 commented Feb 3, 2018

I ve made some progress rewriting the query to use sideEffect() :

g.V().hasLabel("Firma").sideEffect{ g.V().hasLabel("Adresa").has("adresa",it.get().property('adresa').value()).addE('Location').from(it.get()).next()
}

However after a few seconds OrientDB logs keep showing messages like :
"2018-02-04 00:39:11:369 WARNI {db=ter1050} This database instance has 1260 open command/query result sets, please make sure you close them with OResultSet.close()"

...and then the query suddenly stops before it finish to write all the edges.

It might be something wrong with my query because I am a Gremlin newbie.....or I hit another bug/limitation?

@wolf4ood
Copy link
Member

wolf4ood commented Feb 4, 2018

Hi @misu200

how are you executing this traversa?

g.V().hasLabel("Firma").as("a").
V().hasLabel("Adresa").as("b").
where("a", eq("b")).by("adresa").
addE("Location").from("a").to("b")

with the gremlin-console through the embedded gremlin-server?

Thanks

@wolf4ood wolf4ood self-assigned this Feb 4, 2018
@misu200
Copy link
Author

misu200 commented Feb 4, 2018

Hi @maggiolo00,

I ve tried it both ways:

  1. Run it in OrientDB Studio web interface
  2. Gremlin Console....something like this:
g = new OrientGraphFactory("plocal:databases/ter1050").getNoTx().traversal()
g.V().hasLabel("Firma").has("cui","33034700").as("a").V().hasLabel("Adresa").as("b").where("a",eq("b")).by("adresa").addE("Location").from("a").to("b").properties("tip","adresa_anaf")

It is hitting the index for first traversal filter ( has("cui","33034700") ) but for the mid-traversal is not hitting the index .

Thanks,

@wolf4ood
Copy link
Member

wolf4ood commented Feb 5, 2018

Hi @misu200

yes the index is used in first traversal index. I think mid-traversal is not supported yet.

Let me check for the logs that could be a bug

Thanks

@Laurix1983
Copy link

Any idea when the midtraversal index could be in use? This is a pretty serious problem for myself

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

No branches or pull requests

3 participants