| Limit (cost=5188.64..5189.69 rows=20 width=119) |
| -> Unique (cost=5188.64..5626.54 rows=8341 width=119) |
| -> Sort (cost=5188.64..5209.49 rows=8341 width=119) |
| Sort Key: (CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 1001)) THEN 1 ELSE 0 END) DESC, r.created_at DESC, r.id, r.status, r.amount, r.occurrence_at, r.settle_accounts_at, r.settle_accounts_by, r.description, r.created_by, r.updated_at, r.refuse_description, r.client_id, r.project_id, r.next_verify_user, r.is_resubmited, r.work_log_id, r.pre_sales_id, r.implement_record_id, r.have_invoice |
| -> HashAggregate (cost=4520.27..4645.39 rows=8341 width=119) |
| Group Key: r.id, CASE WHEN ((rvr.status = 0) AND (r.next_verify_user = 1001)) THEN 1 ELSE 0 END |
| -> Hash Left Join (cost=2812.11..4478.57 rows=8341 width=119) |
| Hash Cond: (r.id = rsr.reimbursement_id) |
| -> Hash Right Join (cost=2576.42..4076.07 rows=8337 width=119) |
| Hash Cond: (dt2.object_id = r.id) |
| -> Seq Scan on tbl_term_taxonomy_relationships dt2 (cost=0.00..1470.03 rows=2196 width=4) |
| Filter: ((term_id = 18) AND (object_type = 7)) |
| -> Hash (cost=2472.20..2472.20 rows=8337 width=119) |
| -> Hash Right Join (cost=1049.85..2472.20 rows=8337 width=119) |
| Hash Cond: (dt1.object_id = r.id) |
| -> Seq Scan on tbl_term_taxonomy_relationships dt1 (cost=0.00..1308.03 rows=8476 width=4) |
| Filter: (term_id = 15) |
| -> Hash (cost=945.64..945.64 rows=8337 width=119) |
| -> Hash Join (cost=513.40..945.64 rows=8337 width=119) |
| Hash Cond: (rvr.reimbursement_id = r.id) |
| -> Seq Scan on tbl_reimbursement_verify_rels rvr (cost=0.00..410.29 rows=8359 width=8) |
| Filter: (user_id = 1001) |
| -> Hash (cost=408.34..408.34 rows=8405 width=115) |
| -> Seq Scan on tbl_reimbursements r (cost=0.00..408.34 rows=8405 width=115) |
| Filter: (status <> 0) |
| -> Hash (cost=130.31..130.31 rows=8431 width=4) |
| -> Seq Scan on tbl_reimbursement_settle_rels rsr (cost=0.00..130.31 rows=8431 width=4) |