3 ms·
As I said "Useful abstractions always have their limits" you can represent any tree using the relational model. The basic problem is recursive data structures
by Retric 17y ago
As I said "Useful abstractions always have their limits" you can represent any tree using the relational model. The basic problem is recursive data structures need a higher level of abstraction. Consider the following situation:
Bob is managed by Ted
Ted is managed by Bob
If that situation is allowed then all recursive queries need to deal with it. On the other hand if it is NOT allowed then every commit needs to deal with it. However, while the relational model does not understand those issues just like it does not understand HTML it still stores the data just fine. Generally it's a fairly moot point because it's a program talking to the database and not a person, so that program can provide that level of abstraction just fine, granted it's less efficient than a model that understood the abstraction.
As to speed, Relational Databases are the x86 chips of the Database world. There are plenty of custom system that are faster doing specific things, but they sacrifice speed for adaptability and backwards comparability. For example: A core 2 chip's instruction decoder and an SQL databases query optimizer do basically the same thing. With a custom solution you can just skip that step and directly say what to do, but the abstraction is normally worth it so you can upgrade the hardware for years without changing the program.
So the relational model makes the basic assumption that speed is not the primary concern or you would be writing at a more basic level, yet people want more speed so there are plenty of real world hacks to help things along like CONNECT BY and stored procedures, and all those new x86 instructions. So, 99.9% of the time in the real world an of the shelf database running on an x86 chip is plenty fast if used correctly and it's also fairly cheap compared to the total costs of the other solutions.