Yeah that's basically what was discussed here: <a href="https://lobste.rs/s/xz6fwz/unix_find_expressions_compiled_bytecode" rel="nofollow">https://lobste.rs/s/xz6fwz/unix_find_expressions_compiled_by...</a><p>And then I pointed to this article on databases: <a href="https://notes.eatonphil.com/2023-09-21-how-do-databases-execute-expressions.html" rel="nofollow">https://notes.eatonphil.com/2023-09-21-how-do-databases-exec...</a><p>Even MySQL, Duck DB, and Cockroach DB apparently use tree-walking to evaluate expressions, not bytecode!<p>Probably for the same reason - many parts are dominated by I/O, so the work on optimization goes elsewhere<p>And MySQL is a super-mature codebase
I was just reading a paper about compiling SQL queries (actually about a fast compilation technique that allows for full compilation to machine code that is suitable for SQL and WASM): <a href="https://dl.acm.org/doi/pdf/10.1145/3485513" rel="nofollow">https://dl.acm.org/doi/pdf/10.1145/3485513</a><p>Sounds like many DBs do some level of compilation for complex queries. I suspect this is because SQL has primitives that actually compute things (e.g. aggregations, sorts, etc.). But find does basically none of that. Find is completely IO-bound.