QUERY PLAN
HashAggregate (cost=14.60..14.72 rows=12 width=48)
Group Key: dg.id
-> Hash Left Join (cost=1.41..14.54 rows=12 width=286)
Hash Cond: (d.document_type_id = dg.id)
-> Seq Scan on tbl_documents d (cost=0.00..13.09 rows=12 width=12)
Filter: (created_by = 1000)
-> 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)