QUERY PLAN
Aggregate (cost=13.72..13.73 rows=1 width=8)
-> Sort (cost=13.62..13.64 rows=7 width=611)
Sort Key: d.updated_at DESC
-> Group (cost=13.49..13.52 rows=7 width=611)
Group Key: d.id
-> Sort (cost=13.49..13.50 rows=7 width=12)
Sort Key: d.id
-> Seq Scan on tbl_documents d (cost=0.00..13.39 rows=7 width=12)
Filter: (department_id = 1)