3 ms·
Use hierarchical DBMS is you need trees. Relational does not fit here.
by sklogic 12y ago
Use hierarchical DBMS is you need trees. Relational does not fit here.
- jldugger 12y agoTABLE tree { id INTEGER, data VARCHAR(8), left INTEGER, right INTEGER, PRIMARY KEY(id), FOREIGN KEY(right) REFERENCES tree(id) ON DELETE CASCADE FOREIGN KEY(left) REFERENCES tree(id) ON DELETE CASCADE }
- sklogic 12y agoNow try to convince any CAD company to use this abomination to store their naturally hierarchical geometrical data. Good luck. Your RDBMS will choke to death on even most liberal performance constraints.
- Pxtl 12y agoThe point is that relational algebra happily models trees quite well. The fact that the actual RDBMS and SQL support for trees is piss-poor should be considered a failing of those systems - users very often have data that mixes the relational model and a tree model, because a tree is a special case of a relational model. Splitting that data between two systems would be a bad solution.
- sklogic 12y ago> models trees quite well. Not quite. Performance is far from acceptable, comparing with the heavily tuned hierarchical DBMSes, and I suspect it won't be easy to ever overcome it. Overhead is too big. > because a tree is a special case of a relational model There are many applications which do not need a relational part, when everything fits hierarchical model well. Of course, if there is a need to mix both worlds, there is no other choice but to stay within relational model.