0

I'm confused the query performance when querying in such saturation :

  1. using index

    • query a String type property, which build composite unique index
    • query a Long type property, with composite unique index
  2. using graph vertex id directly

So I wonder whether there would be some difference with such performance ?

1 Answers1

2

So in this case JanusGraph indexes are used to facilitate looking up the vertex id. So if you already have the vertex id and you can skip the index lookup that will be fastest option.

As for querying a String property vs a Long property, a Long will perform better. If the results are cached you'll see very similar performance for both lookups, but if not an empty String in java takes up 40 bytes and then grows after 20 characters where as a Long takes up 8 bytes. The footprint of Long composite index is smaller and should query faster.

Chris Hupman
  • 408
  • 3
  • 6