QUERY PLAN
Aggregate (cost=8.30..8.31 rows=1 width=32)
-> Index Scan using tbl_sales_contract_invoices_contract_id_idx on tbl_sales_contract_invoices (cost=0.28..8.30 rows=1 width=6)
Index Cond: (contract_id = 4291)