QUERY PLAN
Aggregate (cost=99.71..99.72 rows=1 width=8)
-> Append (cost=0.00..99.69 rows=9 width=0)
-> Subquery Scan on "*SELECT* 1" (cost=0.00..93.59 rows=7 width=0)
-> Seq Scan on tbl_purchase_contracts (cost=0.00..93.52 rows=7 width=434)
Filter: ((cost_type = 1) AND (supplier_id = 431) AND ((amount - erp_all_settle_amount) > '0'::numeric))
-> Subquery Scan on "*SELECT* 3" (cost=0.00..3.19 rows=1 width=0)
-> Seq Scan on tbl_erp_cost_tickets (cost=0.00..3.18 rows=1 width=242)
Filter: ((status = 2) AND (supplier_id = 431) AND ((amount - all_settle_amount) > '0'::numeric))
-> Subquery Scan on "*SELECT* 4" (cost=0.00..2.91 rows=1 width=0)
-> Seq Scan on tbl_erp_other_payment_tickets (cost=0.00..2.90 rows=1 width=242)
Filter: ((status = 2) AND (supplier_id = 431) AND ((amount - all_settle_amount) > '0'::numeric))