panosfol commented on issue #995:
URL: https://github.com/apache/age/issues/995#issuecomment-1605611963
> The first vertex created of any graph in any database with any name, any
label, any number of properties and any values have this particular id:
844424930131969
This isn't completely accurate.
`Id`'s of vertices are tied to the `label id`. The first label table that is
created in any graph is the `_ag_label_vertex` with `id = 1` and the second is
`_ag_label_edge` with `id = 2`.
After applying a bit mask in the `label id` the vertex/edge `id` is
generated and combined with a sequence you get the incremented `id`'s of the
different vertices and edges.
However your comment was a bit incorrect because the first vertex doesn't
always have the `id` you provided. If you create a vertex with no label the
resulting `id` will be `281474976710657` because thats the resulting number
after applying the bit shift mask to the number `1` (since `1` is the label id
for the vertices that have no labels).
So basically `id`'s are entirely tied by the `label id`, and that is tied to
the order of creating different labels, always starting at `3` for the first
label created (since `1` and `2` are reserved when we create the graph by the
default labels). After applying the mask you get the different `ids` of
vertices and edges.
I think the reason that the different `id`'s have that mathimatical property
that you provided, is entirely based on the mask that we are using and it is
not helpful by itself since it is just a side effect of the creating process.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]