Aggregate (cost=110.91..110.92 rows=1 width=32) |
-> Unique (cost=110.23..110.69 rows=8 width=394) |
-> Sort (cost=110.23..110.25 rows=8 width=394) |
Sort Key: (CASE WHEN (rvr.status = 0) THEN 1 ELSE 0 END) DESC, r.id, r.client_id, r.project_id, r.title, r.status, r.next_verify_user, r.verify_at, r.description, r.refuse_description, r.is_resubmited, r.created_by, r.created_at, r.updated_at, r.supplier_id, r.purchase_contract_id, r.amount, r.borrow_amount, r.borrow_collect_day, r.borrow_collect_status, r.borrow_collect_description, r.borrow_collect_at |
-> Group (cost=110.03..110.11 rows=8 width=394) |
Group Key: (CASE WHEN (rvr.status = 0) THEN 1 ELSE 0 END), r.id |
-> Sort (cost=110.03..110.05 rows=8 width=394) |
Sort Key: (CASE WHEN (rvr.status = 0) THEN 1 ELSE 0 END) DESC, r.id |
-> Nested Loop Left Join (cost=0.57..109.91 rows=8 width=394) |
-> Nested Loop (cost=0.28..95.85 rows=8 width=394) |
-> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..37.46 rows=8 width=8) |
Filter: (user_id = 1000) |
-> Index Scan using tbl_approves_pkey on tbl_approves r (cost=0.28..7.30 rows=1 width=390) |
Index Cond: (id = rvr.approve_id) |
Filter: (status <> 0) |
-> Index Only Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..1.75 rows=1 width=4) |
Index Cond: ((object_id = r.id) AND (term_id = 17)) |