4 ms·
It's a O(log(n)) operation, but we aren't talking log base 2(100,000), since it's usually a B+tree, not just a B-tree. In practice, you don't usually end up wit
by batbomb 12y ago
It's a O(log(n)) operation, but we aren't talking log base 2(100,000), since it's usually a B+tree, not just a B-tree. In practice, you don't usually end up with a B+tree more than 4 levels deep.
So, we are usually talking 3, at most 4 buffer reads for the index, and possibly an extra read to an additional buffer or disk if you need non-indexed data, assuming the amount of managers is fairly smaller than employees. Follow the 5 minute rule (you should have enough memory for anything you might touch every 5 minutes) and in practice you get will probably get similar performance to a graph database.
You'd be surprised what you can do with recursive common table expressions in SQLite, Postgres, and Oracle too.