QUERY PLAN
Aggregate (cost=28.88..28.89 rows=1 width=8)
-> Sort (cost=28.53..28.59 rows=23 width=588)
Sort Key: cd.created_at DESC
-> HashAggregate (cost=27.78..28.01 rows=23 width=588)
Group Key: cd.id
-> Seq Scan on tbl_client_documents cd (cost=0.00..27.73 rows=23 width=12)
Filter: (client_id = 518)