Skip to content

Lots of individual SliceQuery results in .profile() #2984

Answered by li-boxuan
joshluck asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like your first part of the query,

g.V().has("id", "x").out("has_interface").both("link").dedup()

returns a lot of vertices. Then, for each vertex, JanusGraph fires a backend query to fetch

coalesce(__.in("has_interface"), __.identity())

So your profiler suggests that query.batch is not working for you. Looks like this is due to the coalesce step. This is a limitation of JanusGraph. It does not optimize every TinkerPop step.

What you could do is to split your query into two. In the first query, you run g.V().has("id", "x").out("has_interface").both("link").dedup() to fetch a list of vertices. Then, you use multi-threading to fire g.V(v).coalesce(__.in("has_interface"), __.identity())

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@joshluck
Comment options

@li-boxuan
Comment options

@joshluck
Comment options

Answer selected by joshluck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants