The cost will be higher if we use Group By where as the correlated query will give less cost.

I have analyzed both my query and Carp's query. I found that my query uses Sort Aggregate and Carp's query uses Sort Group by.

I feel SORT AGGREGATE will be faster than SORT GROUP BY.

Carp, do you have experience on this?