Re: Index on a vertex label from Java

Peter Schwarz <kkup...@...>

Hmm, maybe I'll try that, thanks.  I briefly considered that approach, but ended up going with indexes on a "pseudo-label" instead.

On Monday, August 14, 2017 at 8:15:53 AM UTC-7, Rafael Fernandes wrote:
I actually needed to do the same thing back when I started my project, but I just ended up using edges instead of vertex labels...
vertex centric indexes helped and improved the performance like crazy (today we can even filter by the period we want without any degradation).

if you still can, just create a VCI on an edge and add all your vertices to that and query against it, your graph will thank you later :)...

rafael fernandes

On Tuesday, August 8, 2017 at 8:34:57 PM UTC-4, Peter Schwarz wrote:
Not the answer I was hoping for, but thanks!

On Tuesday, August 8, 2017 at 8:15:48 AM UTC-7, Jason Plurad wrote:
You can't create an index on a vertex label right now. See

You can create an index on a property. For example, you could define a property called "mylabel", create a composite index on it, then do g.V().has("mylabel", "foo").count().next().

On Monday, August 7, 2017 at 5:06:19 PM UTC-4, Peter Schwarz wrote:
How does one create an index on a vertex label from Java?  I want to speed up queries that retrieve or count the vertices with a  particular label, e.g. g.V().hasLabel("foo").count().next().  In Gremlin-Groovy, I think you can use getPropertyKey(T.label) to reference the key that represents a label and pass that to addKey, but this does not work in Java because getPropertyKey expects a String and T.label is an enum.  What's the right way to do this?

Join to automatically receive all group messages.