Database experts, should I use a separate query or a subquery? 🤔
For example, I want to retrieve the author's name for all the posts. Should I add a subquery to fetch that name, or use a separate query to get the names and then map them with the posts? 🧐
Back
•
In response to @MrPunyapal
Basically if we talk about laravel then it was
with() vs withAggregate().
First case $post->author->name and 2nd case $post->author_name 🧐