QUERY PLAN
Limit (cost=1430.11..1431.11 rows=20 width=119)
-> Unique (cost=1430.11..1431.16 rows=21 width=119)
-> Sort (cost=1430.11..1430.16 rows=21 width=119)
Sort Key: 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.project_id, r.next_verify_user, r.is_resubmited, r.work_log_id, r.pre_sales_id, r.implement_record_id, r.have_invoice, (CASE WHEN (r.status = 2) THEN 1 ELSE 0 END)
-> Group (cost=1429.32..1429.65 rows=21 width=119)
Group Key: r.id
-> Sort (cost=1429.32..1429.46 rows=56 width=115)
Sort Key: r.id
-> Hash Right Join (cost=988.91..1427.69 rows=56 width=115)
Hash Cond: (rvr.reimbursement_id = r.id)
-> Seq Scan on tbl_reimbursement_verify_rels rvr (cost=0.00..354.43 rows=22343 width=4)
-> Hash (cost=988.65..988.65 rows=21 width=115)
-> Nested Loop Left Join (cost=430.25..988.65 rows=21 width=115)
-> Nested Loop Left Join (cost=429.96..752.84 rows=21 width=115)
-> Hash Right Join (cost=429.67..582.12 rows=21 width=115)
Hash Cond: (rsr.reimbursement_id = r.id)
-> Seq Scan on tbl_reimbursement_settle_rels rsr (cost=0.00..130.31 rows=8431 width=4)
-> Hash (cost=429.40..429.40 rows=21 width=115)
-> Seq Scan on tbl_reimbursements r (cost=0.00..429.40 rows=21 width=115)
Filter: ((status <> 0) AND (client_id = 982))
-> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.12 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 15))
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt2 (cost=0.29..11.22 rows=1 width=4)
Index Cond: ((object_id = r.id) AND (term_id = 18))
Filter: (object_type = 7)