QUERY PLAN
Unique (cost=0.02..0.08 rows=1 width=118)
-> Sort (cost=0.02..0.03 rows=1 width=118)
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.client_id, r.project_id, r.next_verify_user, r.is_resubmited, r.work_log_id, r.pre_sales_id, r.implement_record_id, (CASE WHEN (r.status = 2) THEN 1 ELSE 0 END)
-> HashAggregate (cost=0.00..0.01 rows=1 width=118)
Group Key: r.id
-> Result (cost=0.00..0.00 rows=0 width=114)
One-Time Filter: false