Thanks for this great example of refactoring problem queries. I’d love to see an example of the database indexing you mentioned as this is not something many people seem to demonstrate.
I totally agree. It's a good point @seppdaniel BTW. However the performance difference between `COUNT('id')` and `COUNT(*)` is negligible, especially when 'id' is the primary key and non-NULL values.
Thank you for your comment. Creating *index* is straight forward. Therefore I didn't cover it here. FYI: laravel.com/docs/10.x/migrations#creating-indexes I have plan to cover it to other video in different context, not for this scenario.
Awesome explain. Thanks. We want more video on query optimization
Thanks for this great example of refactoring problem queries. I’d love to see an example of the database indexing you mentioned as this is not something many people seem to demonstrate.
Thanks for your comment. I will consider to create another video for that.
You should not COUNT('id'), but rather COUNT('*') and thus let database decide which column is fastest to count.
I totally agree. It's a good point @seppdaniel BTW.
However the performance difference between `COUNT('id')` and `COUNT(*)` is negligible, especially when 'id' is the primary key and non-NULL values.
Awesome btw do you intend to cover database indexing in any future videos n how to implement it in Laravel
Thank you for your comment.
Creating *index* is straight forward. Therefore I didn't cover it here. FYI: laravel.com/docs/10.x/migrations#creating-indexes
I have plan to cover it to other video in different context, not for this scenario.
We want more video on query optimization
amazing stuff
which theme and font?
Hi, Please share source code for this
YAN1FT = Yet Another N+1 Fixing Tutorial.