QUERY PLAN
Sort (cost=91.15..91.20 rows=22 width=26)
Sort Key: id
-> Seq Scan on tbl_sales_contract_invoices (cost=0.00..90.66 rows=22 width=26)
Filter: (contract_id = ANY ('{4422,4278,4246,3337,3404,3472,3465,3580,3602,3646,3670,3677,3749,3811,3809,3833,3841}'::integer[]))