3 ms·
I've worked on both an RDBMS optimizer and a CSS engine, and while the comparison is interesting, it's also not quite right. In particular, you can write pretty
by Sesse__ 3y ago
I've worked on both an RDBMS optimizer and a CSS engine, and while the comparison is interesting, it's also not quite right. In particular, you can write pretty crappy CSS and it will work quite alright, including in all major browsers. Database engines are not like that; there are more ways of doing everything, the bad choices are _really_ bad, and the heuristics much more prone to suddenly do really slow things based on reasonable queries. Most optimization differences between versions and engines are about constant factors and not radically different algorithms (although for some select topics, like invalidation, you may get burned). Even if you write a truly horrible CSS rule, it is unlikely to freeze your page for a minute in any current browser. This is not because browser engineers are more talented than RDBMS engineers, it's just a much simpler problem.
You're right in that there's less information out there for CSS engines (from flipping through slides on this talk, it looks like a great way to improve on that situation!), but there's just a lot more to _say_ about SQL performance. And a lot of what's being said about the latter is honestly pretty sketchy :-)