QUERY PLAN
Aggregate (cost=3933.44..3933.45 rows=1 width=8)
-> Sort (cost=3903.47..3908.46 rows=1998 width=4240)
Sort Key: c.updated_at DESC
-> Subquery Scan on c (cost=113.98..153.94 rows=1998 width=4240)
-> HashAggregate (cost=113.98..133.96 rows=1998 width=4144)
Group Key: c_1.id
-> Seq Scan on tbl_clients c_1 (cost=0.00..108.98 rows=1998 width=12)