QUERY PLAN
Aggregate (cost=206.64..206.65 rows=1 width=32)
-> HashAggregate (cost=149.37..186.18 rows=1636 width=36)
Group Key: sc.id
-> Hash Right Join (cost=84.82..130.13 rows=1924 width=17)
Hash Cond: (sci.contract_id = sc.id)
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..40.25 rows=1925 width=10)
-> Hash (cost=64.37..64.37 rows=1636 width=15)
-> Seq Scan on tbl_sales_contracts sc (cost=0.00..64.37 rows=1636 width=15)
Filter: including_tax