| Aggregate (cost=33.17..33.18 rows=1 width=48) |
| -> Unique (cost=23.93..29.87 rows=88 width=153) |
| -> Sort (cost=23.93..24.15 rows=88 width=153) |
| Sort Key: (CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 1001)) THEN 1 ELSE 0 END) DESC, (CASE WHEN ((crvr.status = 0) AND (r.next_cancel_verify_user = 1001)) THEN 1 ELSE 0 END) DESC, r.id, r.title, r.status, r.leave_type, r.leave_start, r.leave_start_type, r.leave_end, r.leave_end_type, r.next_verify_user, r.verify_at, r.next_cancel_verify_user, r.cancel_at, r.description, r.refuse_description, r.is_resubmited, r.created_by, r.created_at, r.updated_at, r.spent_day, r.cancel_description, r.leave_start_time, r.leave_end_time, r.leave_mode, r.spent_hour |
| -> HashAggregate (cost=19.33..21.09 rows=88 width=153) |
| Group Key: CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 1001)) THEN 1 ELSE 0 END, CASE WHEN ((crvr.status = 0) AND (r.next_cancel_verify_user = 1001)) THEN 1 ELSE 0 END, r.id |
| -> Hash Left Join (cost=13.05..18.67 rows=88 width=153) |
| Hash Cond: (r.id = crvr.punch_leave_id) |
| -> Hash Join (cost=11.67..15.98 rows=88 width=149) |
| Hash Cond: (rvr.punch_leave_id = r.id) |
| -> Seq Scan on tbl_punch_leave_verify_rels rvr (cost=0.00..4.08 rows=88 width=8) |
| Filter: (user_id = 1001) |
| -> Hash (cost=9.63..9.63 rows=163 width=145) |
| -> Seq Scan on tbl_punch_leaves r (cost=0.00..9.63 rows=163 width=145) |
| -> Hash (cost=1.17..1.17 rows=17 width=8) |
| -> Seq Scan on tbl_punch_leave_cancel_verify_rels crvr (cost=0.00..1.17 rows=17 width=8) |