Vertex centric index not getting used for edge property matching with previously visited edge #3056
Unanswered
csrajmohan
asked this question in
Q&A
Replies: 2 comments 3 replies
-
In the past of JanusGraph we experienced cases where indices were not hit and that could be resolved afterwards. Your use case seems important to support. Would it be possible for you to do two things:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Your query 2 and query 3 look exactly the same except they start from different vertices. Just want to make sure: did you do a reindexing after you create the index? This is required unless when you create the index, you don't have any |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using janusgraph 0.6.1 with cassandra backend. I am facing an issue related to vertex centric indexes.
My graph is of the form:
asset ---flow-->job ---flow-->asset
and I am using the following subgraph query to get edge induced subgraph starting from a given asset vertex.
Query 1, query 2 and query 3 given below are slight variants of that query.
I have a
vertex centric index
defined on edges of type'flow'
on the property'flow_id'.
The queries have a conditional check on edge property
'flow_id'
that is matched with the'flow_id'
property of previously visited edge in same flow. For this the vertex centric index is not getting used.Query 1 and query 2 are not making using of vertex centric index for conditional predicate on
flow_id
property of the edge. Here the condition is to match on the property value of already visited edge. But when I have conditional predicate on flow_id with a constant value, then it uses vertex centric index as in query 3. Why is it happening? Is there a way to rewrite the query in order to make janusgraph utilize the vertex centric index in this scenario.Query 1:
g.V().has("asset_id","asset1234").repeat(__.outE("flow").as("e1").subgraph("subGraph").inV().outE("flow").where(P.eq("e1")).by("flow_id").subgraph("subGraph").inV()).cap("subGraph").next()
Query 2:
g.V().has("asset_id","asset1234").repeat(__.outE("flow").as("e1").subgraph("subGraph").values("flow_id").as("fid").select("e1").inV().outE("flow").has("flow_id",select("fid")).subgraph("subGraph").inV()).cap("subGraph").next()
Query 3:
g.V().has("asset_id","asset1234").repeat(__.outE("flow").as("e1").subgraph("subGraph").values("flow_id").as("fid").select("e1").inV().outE("flow").has("flow_id", "f1").subgraph("subGraph").inV()).cap("subGraph").next()
Thanks for the help.
Beta Was this translation helpful? Give feedback.
All reactions