QUERY PLAN
Aggregate (cost=0.08..0.09 rows=1 width=8)
-> HashAggregate (cost=0.06..0.07 rows=1 width=118)
Group Key: r.id, r.status, r.amount, r.occurrence_at, r.settle_accounts_at, r.settle_accounts_by, r.description, r.created_by, r.created_at, 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