Aggregate (cost=83.09..83.10 rows=1 width=32) |
-> Unique (cost=82.66..82.95 rows=5 width=394) |
-> Sort (cost=82.66..82.68 rows=5 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=82.55..82.60 rows=5 width=394) |
Group Key: (CASE WHEN (rvr.status = 0) THEN 1 ELSE 0 END), r.id |
-> Sort (cost=82.55..82.57 rows=5 width=394) |
Sort Key: (CASE WHEN (rvr.status = 0) THEN 1 ELSE 0 END) DESC, r.id |
-> Nested Loop Left Join (cost=0.57..82.50 rows=5 width=394) |
-> Nested Loop (cost=0.28..73.71 rows=5 width=394) |
-> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..36.21 rows=5 width=8) |
Filter: (user_id = 1000) |
-> Index Scan using tbl_approves_pkey on tbl_approves r (cost=0.28..7.50 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)) |