1

I have a simple query to fetch vertex count in cosmos gremlin database.

g.V('person1').out('know').hasLabel('person').count()

The output of this query is say 1000. The number of RUs consumed by this query is ~466. Just wanted to know if there is any way to optimize this query or the way vertex can be stored is graph.

1 Answers1

0

Adding PartitionKey to the query would help here,

g.V([partitionkey],[vertex id]).out('know').hasLabel('person').count()
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • Thanks for sharing your inputs. I tried this as well but no luck. Just for information, that all my vertex are having different values for partition keys i.e. each vertex is identified by its partition key value. Am I missing out anything here? – Jaspreet Singh Dec 03 '21 at 05:19