I was playing around with db facade and eloquent queries. I have installed clockwork extension, which basically shows sql queries which are ran, time that a query takes to finish execution, and a response time. I generated 10 000 records of posts for testing. I have one to many relationship defined on a User and a Post models.
When I do an eloquent query
User::with('posts')->find(1);
It generates 2 sql queries, without a join

also queries take 36ms to execute, but response time is much longer - 661ms
When I do a query with a DB facade
DB::table('users')->join('posts', 'users.id', '=', 'posts.user_id')->where('users.id', 1)->get();
there is only 1 sql query generated, with a join operation

that 1 query takes a bit more time, because there is a join operation, but response time is much much faster.
It's only 100ms
What i think is happening is that, In case of eloquent, join doesn't happen on database level, which we can see from the generated queries. Isn't that a little weird? databases are designed and optimized, to make operations like that and have lots of mechanisms to make joins faster, like query optimizers , indexes and so on. Why does eloquent do that on laravel's side. Isn't that pretty bad for performance? As we can see from results, eloquent's response time is much longer. Am I misunderstanding something?