Suppose a relationship VertexA -()- VertexB. 1 week ago I deleted some vertices of type VertexB, therefore making some VertexA orphan. And indeed, I can check that it I use neighbors function. However, if I query for all vertices VertexA with outdegree == 0, I get zero results (query example below). And it has been like this for over 1 week.
I know that vertex function outdegree() reads from a pre-calculated metadata. So my question is: when is it updated? Or how can I update it?
CREATE DISTRIBUTED QUERY check_empty() {
orphan_vertices = SELECT v FROM VertexA:v WHERE v.outdegree() == 0;
PRINT orphan_vertices.size();
}
@mlikoga In TigerGraph, the outdegree of a vertex is typically calculated at query time and is not stored as pre-calculated metadata. Therefore, you shouldn’t encounter a situation where the outdegree remains incorrect for an extended period of time.
My first thought would be to verify the consistency of your data. Ensure that the deletion of VertexB instances indeed led to orphaned VertexA instances.
When you run a SELECT statement with VertexA -()- VertexB and then print the size does that return the same result of zero?
I am 100% sure the data is correct and there are orphaned VertexA. As I said, if I use the neighbors() function, like WHERE v.neighbors().size() == 0 I get multiple results.
So if outdegree should be updated, it’s likely a bug in Tigergraph.