[Titan 0.5.1] gremlin DSL / Rexster caching with vertex-centric indexes

40 views
Skip to first unread message

Walter Sobral Andrade

unread,
Feb 17, 2015, 9:26:09 PM2/17/15
to aureliu...@googlegroups.com
Hi everyone,

I've configured a graph via Rexster with vertex-centric index on a "Name" key. So
I populated the graph with a few thousand nodes and the query g.V.has("Name","anyName")
through Rexster was about 80% faster than without vertex-centric index. But I've
written a gremlin DSL which has a step that does the same query:

Gremlin.defineStep('anyName',[Vertex,Pipe],
{anyName -> _().ifThenElse
    {anyName != null}
    {it.has('Name',anyName)}
    {null}
})

But if I run this step, for example, g.V.anyName("name") it runs as slowly as
the isolated g.V.has("Name","name") query without vertex-centrix index in
property "Name". I did not find a specific documentation, so I was wondering
if I was missing some configuration or piece of code for the DSL script which
can be used to make gremlin defined steps take advantage of indexes.

Thanks in advance,

Stephen Mallette

unread,
Feb 19, 2015, 7:56:20 AM2/19/15
to aureliu...@googlegroups.com
You're DSL isn't expressing the same thing as g.V.has() and my guess is that Titan doesn't know how to optimize the traversal that the DSL is producing.  Use toString() at the end of your traversal to see how the pipes are formed up for the traversal and make sure that your DSL produces the same sort of output as the query you are trying to replicate.

--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/6f53196a-ee65-45dd-b740-a5b7720e5806%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Walter Sobral Andrade

unread,
Mar 2, 2015, 8:37:20 AM3/2/15
to aureliu...@googlegroups.com
Hi Stephen, sorry for the delayed reply.

The output was the same, GremlinGroovyPipeline. But I've found a response
from you on stack overflow giving some alternatives for a similar problem. In the
end you mentioned meta-programming as a way to implement steps. So we did
the same you did for Graph, but for GremlinGroovyPipeline and it works just fine.

https://stackoverflow.com/questions/26767553/titan-cassandra-does-not-use-defined-indexes-for-custom-gremlin-steps/26777646#26777646?newreg=b13fc7e1d6a14ec48bd91531a5c6ff70

Thanks a lot, Stephen.
Reply all
Reply to author
Forward
0 new messages