Aggregate (cost=189.41..189.42 rows=1 width=8) |
-> Sort (cost=189.03..189.10 rows=25 width=269) |
Sort Key: (CASE WHEN ((sub.verify_status = 0) OR (sub.stop_verify_status = 0) OR (sub.cancel_verify_status = 0)) THEN 1 ELSE 2 END), sub.created_at DESC |
-> Result (cost=0.00..188.45 rows=25 width=269) |
-> Append (cost=0.00..188.02 rows=25 width=20) |
-> Subquery Scan on sub (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 2" (cost=187.51..187.54 rows=1 width=20) |
-> Group (cost=187.51..187.53 rows=1 width=265) |
Group Key: r.id, rvr.status, rsvr.status, rcvr.status |
-> Sort (cost=187.51..187.52 rows=1 width=24) |
Sort Key: r.id, rvr.status, rsvr.status, rcvr.status |
-> Hash Left Join (cost=66.56..187.50 rows=1 width=24) |
Hash Cond: (r.id = rcvr.erp_purchase_order_id) |
Filter: (((rvr.user_id = 1001) OR (rsvr.user_id = 1001) OR (rcvr.user_id = 1001)) AND ((rvr.status = 0) OR (rsvr.status = 0) OR (rcvr.status = 0))) |
-> Hash Left Join (cost=44.38..157.65 rows=2009 width=28) |
Hash Cond: (r.id = rsvr.erp_purchase_order_id) |
-> Hash Left Join (cost=22.19..127.88 rows=2009 width=20) |
Hash Cond: (r.id = rvr.erp_purchase_order_id) |
-> Seq Scan on tbl_erp_purchase_orders r (cost=0.00..98.11 rows=2009 width=12) |
Filter: (status <> 0) |
-> Hash (cost=22.12..22.12 rows=5 width=12) |
-> Seq Scan on tbl_erp_purchase_order_verify_rels rvr (cost=0.00..22.12 rows=5 width=12) |
Filter: (user_id = 1001) |
-> Hash (cost=22.12..22.12 rows=5 width=12) |
-> Seq Scan on tbl_erp_purchase_order_stop_verify_rels rsvr (cost=0.00..22.12 rows=5 width=12) |
Filter: (user_id = 1001) |
-> Hash (cost=22.12..22.12 rows=5 width=12) |
-> Seq Scan on tbl_erp_purchase_order_cancel_verify_rels rcvr (cost=0.00..22.12 rows=5 width=12) |
Filter: (user_id = 1001) |
-> Subquery Scan on "*SELECT* 3" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 4" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 5" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 6" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status, status |
-> Result (cost=0.00..0.00 rows=0 width=24) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 7" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 8" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 9" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 10" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 11" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 12" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 13" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 14" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 15" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 16" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 17" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 18" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 19" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 20" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status, status |
-> Result (cost=0.00..0.00 rows=0 width=24) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 21" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 22" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 23" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 24" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |
-> Subquery Scan on "*SELECT* 25" (cost=0.00..0.02 rows=1 width=20) |
-> HashAggregate (cost=0.00..0.01 rows=1 width=265) |
Group Key: id, status, status |
-> Result (cost=0.00..0.00 rows=0 width=20) |
One-Time Filter: false |