QUERY PLAN
Aggregate (cost=31.98..31.99 rows=1 width=32)
-> Hash Join (cost=19.08..31.98 rows=2 width=32)
Hash Cond: (sci.contract_id = c.id)
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..12.10 rows=210 width=36)
-> Hash (cost=19.07..19.07 rows=1 width=4)
-> Hash Join (cost=8.17..19.07 rows=1 width=4)
Hash Cond: (c.project_id = p.id)
-> Seq Scan on tbl_sales_contracts c (cost=0.00..10.70 rows=70 width=8)
-> Hash (cost=8.16..8.16 rows=1 width=4)
-> Index Scan using tbl_projects_created_by_idx on tbl_projects p (cost=0.14..8.16 rows=1 width=4)
Index Cond: (created_by = 5495)