Aggregate (cost=48.03..48.04 rows=1 width=8) |
-> Sort (cost=48.02..48.02 rows=1 width=330) |
Sort Key: sci.from_date DESC, sci.created_at DESC |
-> Group (cost=48.00..48.01 rows=1 width=330) |
Group Key: sci.id |
-> Sort (cost=48.00..48.00 rows=1 width=16) |
Sort Key: sci.id |
-> Seq Scan on tbl_sales_contract_invoices sci (cost=0.00..47.99 rows=1 width=16) |
Filter: ((cover_invoice_id IS NULL) AND (NOT is_cancel) AND ((invoice_type <> '-1'::smallint) OR (invoice_type IS NULL)) AND (contract_id = 4138)) |