QUERY PLAN
HashAggregate (cost=16.81..16.99 rows=18 width=48)
Group Key: dg.id
-> Hash Left Join (cost=1.41..14.78 rows=407 width=286)
Hash Cond: (d.document_type_id = dg.id)
-> Seq Scan on tbl_documents d (cost=0.00..12.07 rows=407 width=12)
-> Hash (cost=1.18..1.18 rows=18 width=278)
-> Seq Scan on tbl_document_types dg (cost=0.00..1.18 rows=18 width=278)