QUERY PLAN
Aggregate (cost=266.20..266.21 rows=1 width=32)
-> Hash Join (cost=217.85..266.02 rows=71 width=6)
Hash Cond: (sci.contract_id = c.id)
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..40.25 rows=1925 width=10)
-> Hash (cost=217.10..217.10 rows=60 width=4)
-> Hash Join (cost=148.42..217.10 rows=60 width=4)
Hash Cond: (c.project_id = p.id)
-> Seq Scan on tbl_sales_contracts c (cost=0.00..64.37 rows=1637 width=8)
-> Hash (cost=147.02..147.02 rows=112 width=4)
-> Bitmap Heap Scan on tbl_projects p (cost=5.15..147.02 rows=112 width=4)
Recheck Cond: (created_by = 1001)
-> Bitmap Index Scan on tbl_projects_created_by_idx (cost=0.00..5.12 rows=112 width=0)
Index Cond: (created_by = 1001)