Monday, May 20, 2024

Getting number of vertices in Tigergraph DB

1) Get vertex id from config.yaml under data directory for corresponding graph and vertex that we are trying to get count.

Example: $ view /tigergraph/data/gstore/0/part/config.yaml


2) Filter the vertex ID from above

$ grep -r -l 'VertexTypeId: 144' /tigergraph/data/gstore/0/part/*/segmentconfig.yaml | xargs grep 'NumOfVertices:' | grep -v "NumOfVertices: 0"

Here,

grep : plain text search

-r : recursive search 0

-l : Print only the names of files with matching lines

xargs : A command that builds and executes command lines from standard input.


(or)

Filtering for deleted vertices.

$ grep -r -l 'VertexTypeId: 43' /tigergraph/data/gstore/0/part/*/segmentconfig.yaml | xargs grep 'NumOfDeletedVertices: '

***

No comments:

Post a Comment