How does a relational database work? (2017)
coding-geek.com
coding-geek.com
Massive facepalm.
A developer who doesn't care about complexity (both structural complexity of the code, and execution-time complexity of algorithms he uses) is simply incompetent. No ifs and no buts about it.
The point is you can care LESS (than in the past) as an effective productivity tactic.
> But when you deal with a large amount of data (I’m not talking about thousands) or if you’re fighting for milliseconds, it becomes critical to understand this concept. And guess what, databases have to deal with both situations!
I think they're just anticipating an audience who only deal with fragments of data in frontend or "backend" services. That statement holds when you're never really dealing with more than tens of elements.
Admittedly, this was a bit of an outlier case, but you get enough of those and you’re spending real money on extra hardware to keep up
Maybe you already understood that but your bug description makes it sound like complexity wasn't necessarily the issue.
Although my example was only O(n^2), the constant of each n being over the wire to the DB blew the runtime up to a significant number. So even an n-squared algorithm with small data sets can kill your app. We changed it to be O(n) over the wire to make it reasonable
A competent programmer understands that in many cases there are much faster ways of doing things with small chunks of data than asymptotically-good algorithms - and that these cases could be performance-critical if executed often.
https://twitter.com/evolvable/status/1113031660637847552
The point, i believe, is that it's okay to think "i know that this code has quadratic complexity, and that is acceptable right now".
You might agree with that even though you consider that it's not okay to think "i don't know what the complexity of this code is" or "i don't know what complexity is".
It might even be okay to think "i don't know what the complexity of this code is, and that is acceptable right now". You should be able to imagine some cases where that would be true.
Is it some terribly ironic post?
It occurred to me that a book about building a database system in an easy to read language would be a great way to get hands on with the various algorithms used by modern database technologies - and may be more broadly useful too
Worldcat shows some libraries have it: https://www.worldcat.org/title/database-design-and-implement...
But in all seriousness, the fundamentals of how relational DB's work and physically execute queries should be at least in the back of the mind of any engineer who writes SQL for a living. Great article!
0: https://www.sqlite.org/fileformat.html