3 ms·
> The problem with a "pointer" like this is that you then can't move stuff around as easily You can, it just requires one further level of pointer indirection.
by phpnode 11y ago
> The problem with a "pointer" like this is that you then can't move stuff around as easily
You can, it just requires one further level of pointer indirection. Rather than pointing to the physical location of the data, you store a pointer to an offset in an array of pointers.
Alternatively you can point directly if you're prepared to update those pointers when you move things around. Luckily a graph database is ideally suited for this kind of operation because it makes discovering those pointers exceptionally simple and efficient.
- lobster_johnson 11y agoYes, that was the solution I sketched out in my last paragraph. Do any databases actually do this?
- phpnode 11y agoThe array of pointers thing is standard/common but I'm not aware of any which use the features of the graph itself to avoid pointer indirection. Typically the edges are stored in some kind of tree structure anyway so I'd guess that the savings aren't worth the added complexity when the thing does a lot of pointer lookups besides the initial one. But I'm probably going to experiment with it in my own db project.