QUERY PLAN
Limit (cost=0.03..0.03 rows=1 width=419)
-> Sort (cost=0.03..0.03 rows=1 width=419)
Sort Key: (CASE WHEN (r.status = 1) THEN 0 ELSE 1 END), (CASE WHEN (r.status = 1) THEN r.created_at ELSE r.verify_at END) DESC, r.created_at DESC
-> HashAggregate (cost=0.00..0.01 rows=1 width=419)
Group Key: r.id
-> Result (cost=0.00..0.00 rows=0 width=407)
One-Time Filter: false