QUERY PLAN
Limit (cost=18.98..19.01 rows=10 width=109)
-> Sort (cost=18.98..19.39 rows=164 width=109)
Sort Key: d.updated_at DESC
-> HashAggregate (cost=13.80..15.44 rows=164 width=109)
Group Key: d.id
-> Seq Scan on tbl_documents d (cost=0.00..13.39 rows=164 width=109)
Filter: (department_id = 2)