QUERY PLAN
Aggregate (cost=375.25..375.26 rows=1 width=32)
-> Hash Join (cost=323.98..372.46 rows=1114 width=6)
Hash Cond: (c.project_id = p.id)
-> Hash Join (cost=84.60..128.17 rows=1866 width=10)
Hash Cond: (sci.contract_id = c.id)
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..38.66 rows=1866 width=10)
-> Hash (cost=63.71..63.71 rows=1671 width=8)
-> Seq Scan on tbl_sales_contracts c (cost=0.00..63.71 rows=1671 width=8)
-> Hash (cost=217.38..217.38 rows=1760 width=4)
-> Seq Scan on tbl_projects p (cost=0.00..217.38 rows=1760 width=4)
Filter: (created_by = ANY ('{1001,1004,1005,1013,5087,5295,5300,5311,5329,5332,5420,5448,5449}'::integer[]))