QUERY PLAN
Limit (cost=16.48..16.50 rows=10 width=109)
-> Sort (cost=16.48..16.62 rows=59 width=109)
Sort Key: d.updated_at DESC
-> HashAggregate (cost=14.61..15.20 rows=59 width=109)
Group Key: d.id
-> Seq Scan on tbl_documents d (cost=0.00..14.46 rows=59 width=109)
Filter: ((document_type_id = 111) AND (department_id = 2))