Actual database also use optimized data structure (such as btree or trie), although it comes down to whether you can utilize it properly or not.
That's correct. The indexes at least are optimized. But the access to the database itself also comes with a cost.
I agree, it's after all up to dev skills and preferences.