Well group by has performance issues for sure, you can solve that by using distinct + joins
@luknei Distinct isn't the same as group by. You can group by multiple fields for example.
This is one of the things that annoys me too. It was quite surprising to see it return incorrect results.
The count() function should already be implemented this way, but it is deliberately crippled because MySQL can't optimize subqueries.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community