QUERY PLAN
Limit (cost=14.49..14.50 rows=1 width=109)
-> Sort (cost=14.49..14.50 rows=1 width=109)
Sort Key: d.updated_at DESC
-> Group (cost=14.47..14.48 rows=1 width=109)
Group Key: d.id
-> Sort (cost=14.47..14.48 rows=1 width=109)
Sort Key: d.id
-> Seq Scan on tbl_documents d (cost=0.00..14.46 rows=1 width=109)
Filter: ((document_type_id = 41) AND (department_id = 2))