| Aggregate (cost=112.48..112.49 rows=1 width=8) |
| -> Group (cost=112.45..112.47 rows=1 width=469) |
| Group Key: r.id, (CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 5064)) THEN 1 WHEN ((rcvr.status = 0) AND (r.next_cancel_verify_user = 5064)) THEN 2 ELSE 0 END) |
| -> Sort (cost=112.45..112.45 rows=1 width=8) |
| Sort Key: r.id, (CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 5064)) THEN 1 WHEN ((rcvr.status = 0) AND (r.next_cancel_verify_user = 5064)) THEN 2 ELSE 0 END) |
| -> Nested Loop Left Join (cost=0.57..112.44 rows=1 width=8) |
| -> Nested Loop Left Join (cost=0.28..104.11 rows=1 width=20) |
| Join Filter: (rcvr.approve_id = r.id) |
| Filter: (((r.next_verify_user = 5064) AND (rvr.status = 0)) OR ((r.next_cancel_verify_user = 5064) AND (rcvr.status = 0))) |
| -> Nested Loop (cost=0.28..103.05 rows=1 width=16) |
| -> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..61.79 rows=4 width=8) |
| Filter: (user_id = 5064) |
| -> Index Scan using tbl_approves_pkey on tbl_approves r (cost=0.28..8.31 rows=1 width=20) |
| Index Cond: (id = rvr.approve_id) |
| Filter: ((status <> 0) AND (status = ANY ('{1,5}'::integer[])) AND ((next_verify_user = 5064) OR (next_cancel_verify_user = 5064))) |
| -> Seq Scan on tbl_approve_cancel_verify_rels rcvr (cost=0.00..1.02 rows=2 width=8) |
| -> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.31 rows=1 width=4) |
| Index Cond: ((object_id = r.id) AND (term_id = 17)) |