| Aggregate (cost=89.06..89.07 rows=1 width=8) |
| -> Sort (cost=88.99..89.00 rows=5 width=413) |
| Sort Key: (min(CASE WHEN (1 = r.verify_type) THEN CASE WHEN (rvr.status = 0) THEN 1 WHEN (rsvr.status = 0) THEN 2 ELSE 4 END ELSE CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 1001)) THEN 1 WHEN ((rsvr.status = 0) AND (r.next_stop_verify_user = 1001)) THEN 2 ELSE 4 END END)), r.created_at DESC |
| -> GroupAggregate (cost=88.70..88.93 rows=5 width=413) |
| Group Key: r.id |
| -> Merge Left Join (cost=88.70..88.77 rows=5 width=30) |
| Merge Cond: (r.id = rsvr.erp_collect_ticket_id) |
| -> Sort (cost=87.57..87.58 rows=5 width=26) |
| Sort Key: r.id |
| -> Hash Right Join (cost=82.84..87.51 rows=5 width=26) |
| Hash Cond: (rvr.erp_collect_ticket_id = r.id) |
| -> Seq Scan on tbl_erp_collect_ticket_verify_rels rvr (cost=0.00..3.93 rows=193 width=8) |
| -> Hash (cost=82.78..82.78 rows=5 width=22) |
| -> Nested Loop (cost=0.28..82.78 rows=5 width=22) |
| -> Seq Scan on tbl_erp_collect_ticket_settles ectss (cost=0.00..41.29 rows=5 width=4) |
| Filter: (sales_contract_id = 2148) |
| -> Index Scan using tbl_erp_collect_tickets_pkey on tbl_erp_collect_tickets r (cost=0.28..8.30 rows=1 width=22) |
| Index Cond: (id = ectss.erp_collect_ticket_id) |
| -> Sort (cost=1.14..1.15 rows=6 width=8) |
| Sort Key: rsvr.erp_collect_ticket_id |
| -> Seq Scan on tbl_erp_collect_ticket_stop_verify_rels rsvr (cost=0.00..1.06 rows=6 width=8) |