QUERY PLAN
Aggregate (cost=96.03..96.04 rows=1 width=8)
-> HashAggregate (cost=50.40..70.68 rows=2028 width=346)
Group Key: sci.id
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..45.33 rows=2028 width=4)
Filter: (cover_invoice_id IS NULL)