QUERY PLAN
Limit (cost=81.44..81.49 rows=20 width=317)
-> Sort (cost=81.44..81.94 rows=198 width=317)
Sort Key: (CASE WHEN ((sub.verify_status = 0) OR (sub.stop_verify_status = 0) OR (sub.cancel_verify_status = 0)) THEN 1 WHEN (sub.self_verify_at IS NOT NULL) THEN 2 ELSE 3 END), (CASE WHEN ((sub.verify_status = 0) OR (sub.stop_verify_status = 0) OR (sub.cancel_verify_status = 0)) THEN sub.created_at ELSE NULL::timestamp with time zone END) DESC NULLS LAST, sub.self_verify_at DESC NULLS LAST, sub.last_verify_at DESC NULLS LAST, sub.created_at DESC
-> Result (cost=0.00..76.17 rows=198 width=317)
-> Append (cost=0.00..71.22 rows=198 width=305)
-> Subquery Scan on sub (cost=0.00..0.05 rows=1 width=182)
-> HashAggregate (cost=0.00..0.04 rows=1 width=190)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=123)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 2" (cost=0.00..0.06 rows=1 width=213)
-> HashAggregate (cost=0.00..0.05 rows=1 width=225)
Group Key: id, status, status, status
-> Result (cost=0.00..0.00 rows=0 width=170)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 3" (cost=0.00..0.05 rows=1 width=246)
-> HashAggregate (cost=0.00..0.04 rows=1 width=254)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=179)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 4" (cost=0.00..0.05 rows=1 width=182)
-> HashAggregate (cost=0.00..0.04 rows=1 width=190)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=111)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 5" (cost=0.00..0.05 rows=1 width=222)
-> HashAggregate (cost=0.00..0.04 rows=1 width=230)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=159)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 6" (cost=0.00..0.05 rows=1 width=176)
-> HashAggregate (cost=0.00..0.04 rows=1 width=184)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=105)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 7" (cost=0.00..0.05 rows=1 width=231)
-> HashAggregate (cost=0.00..0.04 rows=1 width=239)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=160)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 8" (cost=60.80..69.68 rows=169 width=321)
-> HashAggregate (cost=60.80..67.99 rows=169 width=329)
Group Key: r.id, rvr.status, rsvr.status
-> Hash Left Join (cost=44.38..57.85 rows=169 width=250)
Hash Cond: (r.id = rsvr.erp_inventory_transfer_id)
-> Hash Left Join (cost=22.19..34.99 rows=169 width=238)
Hash Cond: (r.id = rvr.erp_inventory_transfer_id)
-> Seq Scan on tbl_erp_inventory_transfers r (cost=0.00..12.12 rows=169 width=226)
Filter: (status <> 0)
-> Hash (cost=22.12..22.12 rows=5 width=16)
-> Seq Scan on tbl_erp_inventory_transfer_verify_rels rvr (cost=0.00..22.12 rows=5 width=16)
Filter: (user_id = 1000)
-> Hash (cost=22.12..22.12 rows=5 width=16)
-> Seq Scan on tbl_erp_inventory_transfer_stop_verify_rels rsvr (cost=0.00..22.12 rows=5 width=16)
Filter: (user_id = 1000)
-> Subquery Scan on "*SELECT* 9" (cost=0.00..0.06 rows=1 width=221)
-> HashAggregate (cost=0.00..0.05 rows=1 width=233)
Group Key: id, status, status, status
-> Result (cost=0.00..0.00 rows=0 width=178)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 10" (cost=0.00..0.05 rows=1 width=232)
-> HashAggregate (cost=0.00..0.04 rows=1 width=240)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=165)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 11" (cost=0.00..0.05 rows=1 width=256)
-> HashAggregate (cost=0.00..0.04 rows=1 width=264)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=189)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 12" (cost=0.00..0.05 rows=1 width=184)
-> HashAggregate (cost=0.00..0.04 rows=1 width=192)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=129)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 13" (cost=0.00..0.05 rows=1 width=211)
-> HashAggregate (cost=0.00..0.04 rows=1 width=219)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=144)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 14" (cost=0.00..0.05 rows=1 width=162)
-> HashAggregate (cost=0.00..0.04 rows=1 width=170)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=139)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 15" (cost=0.00..0.05 rows=1 width=167)
-> HashAggregate (cost=0.00..0.04 rows=1 width=175)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=145)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 16" (cost=0.00..0.05 rows=1 width=219)
-> HashAggregate (cost=0.00..0.04 rows=1 width=227)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=192)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 17" (cost=0.00..0.05 rows=1 width=188)
-> HashAggregate (cost=0.00..0.04 rows=1 width=196)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=165)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 18" (cost=0.00..0.05 rows=1 width=294)
-> HashAggregate (cost=0.00..0.04 rows=1 width=302)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=231)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 19" (cost=0.00..0.05 rows=1 width=232)
-> HashAggregate (cost=0.00..0.04 rows=1 width=240)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=161)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 20" (cost=0.00..0.05 rows=1 width=175)
-> HashAggregate (cost=0.00..0.04 rows=1 width=183)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=145)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 21" (cost=0.00..0.05 rows=1 width=161)
-> HashAggregate (cost=0.00..0.04 rows=1 width=169)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=131)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 22" (cost=0.00..0.05 rows=1 width=174)
-> HashAggregate (cost=0.00..0.04 rows=1 width=182)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=151)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 23" (cost=0.00..0.05 rows=1 width=196)
-> HashAggregate (cost=0.00..0.04 rows=1 width=204)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=173)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 24" (cost=0.00..0.06 rows=1 width=257)
-> HashAggregate (cost=0.00..0.05 rows=1 width=269)
Group Key: id, status, status, status
-> Result (cost=0.00..0.00 rows=0 width=214)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 25" (cost=0.00..0.05 rows=1 width=217)
-> HashAggregate (cost=0.00..0.04 rows=1 width=225)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=179)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 26" (cost=0.00..0.05 rows=1 width=190)
-> HashAggregate (cost=0.00..0.04 rows=1 width=198)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=152)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 27" (cost=0.00..0.05 rows=1 width=206)
-> HashAggregate (cost=0.00..0.04 rows=1 width=214)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=168)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 28" (cost=0.00..0.05 rows=1 width=197)
-> HashAggregate (cost=0.00..0.04 rows=1 width=205)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=159)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 29" (cost=0.00..0.05 rows=1 width=222)
-> HashAggregate (cost=0.00..0.04 rows=1 width=230)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=184)
One-Time Filter: false
-> Subquery Scan on "*SELECT* 30" (cost=0.00..0.06 rows=1 width=391)
-> HashAggregate (cost=0.00..0.04 rows=1 width=399)
Group Key: id, status, status
-> Result (cost=0.00..0.00 rows=0 width=297)
One-Time Filter: false