QUERY PLAN
Aggregate (cost=278.77..278.78 rows=1 width=32)
-> Hash Join (cost=155.88..278.67 rows=39 width=6)
Hash Cond: (c.from_project = p.id)
-> Seq Scan on tbl_sales_contracts c (cost=0.00..118.25 rows=1725 width=10)
-> Hash (cost=155.00..155.00 rows=71 width=4)
-> Bitmap Heap Scan on tbl_projects p (cost=5.29..155.00 rows=71 width=4)
Recheck Cond: (created_by = 1001)
Filter: (project_status = 3)
-> Bitmap Index Scan on tbl_projects_created_by_idx (cost=0.00..5.27 rows=132 width=0)
Index Cond: (created_by = 1001)