QUERY PLAN
Aggregate (cost=446.59..446.60 rows=1 width=32)
-> Hash Join (cost=386.85..443.40 rows=1276 width=6)
Hash Cond: (c.project_id = p.id)
-> Hash Join (cost=139.81..190.75 rows=2133 width=10)
Hash Cond: (sci.contract_id = c.id)
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..45.33 rows=2133 width=10)
-> Hash (cost=118.25..118.25 rows=1725 width=8)
-> Seq Scan on tbl_sales_contracts c (cost=0.00..118.25 rows=1725 width=8)
-> Hash (cost=223.55..223.55 rows=1879 width=4)
-> Seq Scan on tbl_projects p (cost=0.00..223.55 rows=1879 width=4)
Filter: (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476}'::integer[]))