Efficient persistent data structures for relationa

2020-02-23 10:50发布

I'm looking for material on persistent data structures that can be used to implement a relational model.

Persistence in the meaning of immutable data structures.

Anyone know of some good resources, books, papers and such?

(I already have the book Purely Functional Data Structures, which is a good example of what I'm looking for.)

3条回答
三岁会撩人
2楼-- · 2020-02-23 11:26

It is straightforward to modify the ubiquitous B-tree to be persistent. Simply always alloctate a new node whenever a node is modified, and return the new node to the recursive caller, who will insert it at that level by allocating a new node, etc. Ultimate the new root node is returned. No more than O(log N) nodes are allocated per operation.

This is the technique used in functional languages to implement, e.g, 2-3 trees.

查看更多
等我变得足够好
3楼-- · 2020-02-23 11:29

I have implemented such a data structure for BergDB (http://bergdb.com/) - a database with a data model that is a persistent data structure.

I would suggest reading

http://www.cs.cmu.edu/~sleator/papers/Persistence.htm

It is the original work on how to create a persistant data structure based on an ordinary (ephemeral) one.

查看更多
▲ chillily
4楼-- · 2020-02-23 11:41

SQLite has an b-tree data structure implementation you can take a look at;

查看更多
登录 后发表回答