QUERY PLAN
Sort (cost=84.02..84.08 rows=21 width=26)
Sort Key: id
-> Seq Scan on tbl_sales_contract_invoices (cost=0.00..83.56 rows=21 width=26)
Filter: (contract_id = ANY ('{4112,4106,3502,3703,3763,3755,3725,3746,3803,3857,3935,3900,3967,3978,3997,3724,3916,4253}'::integer[]))