| Limit (cost=51.64..51.65 rows=1 width=227) |
| -> Sort (cost=51.64..51.65 rows=1 width=227) |
| 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=51.59..51.63 rows=1 width=227) |
| Group Key: r.id |
| -> Sort (cost=51.59..51.60 rows=1 width=231) |
| Sort Key: r.id |
| -> Nested Loop Left Join (cost=48.28..51.58 rows=1 width=231) |
| Join Filter: (rsvr.erp_collect_ticket_id = r.id) |
| -> Hash Right Join (cost=48.28..50.47 rows=1 width=227) |
| Hash Cond: (rvr.erp_collect_ticket_id = r.id) |
| -> Seq Scan on tbl_erp_collect_ticket_verify_rels rvr (cost=0.00..1.86 rows=86 width=8) |
| -> Hash (cost=48.27..48.27 rows=1 width=223) |
| -> Nested Loop (cost=0.28..48.27 rows=1 width=223) |
| -> Seq Scan on tbl_erp_collect_ticket_settles ectss (cost=0.00..39.96 rows=1 width=4) |
| Filter: (sales_contract_id = 4253) |
| -> Index Scan using tbl_erp_collect_tickets_pkey on tbl_erp_collect_tickets r (cost=0.28..8.30 rows=1 width=223) |
| Index Cond: (id = ectss.erp_collect_ticket_id) |
| -> Seq Scan on tbl_erp_collect_ticket_stop_verify_rels rsvr (cost=0.00..1.05 rows=5 width=8) |