QUERY PLAN
Aggregate (cost=24.71..24.72 rows=1 width=8)
-> Sort (cost=24.68..24.68 rows=2 width=588)
Sort Key: cd.created_at DESC
-> Group (cost=24.66..24.67 rows=2 width=588)
Group Key: cd.id
-> Sort (cost=24.66..24.66 rows=2 width=12)
Sort Key: cd.id
-> Seq Scan on tbl_client_documents cd (cost=0.00..24.65 rows=2 width=12)
Filter: (client_id = 1661)