QUERY PLAN
Aggregate (cost=93.25..93.26 rows=1 width=8)
-> HashAggregate (cost=49.39..68.88 rows=1949 width=346)
Group Key: sci.id
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..44.52 rows=1949 width=4)
Filter: (cover_invoice_id IS NULL)