QUERY PLAN
Aggregate (cost=448.30..448.31 rows=1 width=32)
-> Hash Join (cost=388.56..445.11 rows=1275 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=225.10..225.10 rows=1892 width=4)
-> Seq Scan on tbl_projects p (cost=0.00..225.10 rows=1892 width=4)
Filter: (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5332,5449,5467,5476}'::integer[]))