QUERY PLAN
Aggregate (cost=421.28..421.29 rows=1 width=8)
-> Sort (cost=376.97..384.35 rows=2954 width=238)
Sort Key: r.verify_at DESC NULLS LAST
-> HashAggregate (cost=177.15..206.69 rows=2954 width=238)
Group Key: r.id
-> Hash Right Join (cost=121.47..169.77 rows=2954 width=12)
Hash Cond: (rvr.erp_ticket_change_log_id = r.id)
-> Seq Scan on tbl_erp_ticket_change_log_handlers rvr (cost=0.00..41.37 rows=2637 width=4)
-> Hash (cost=84.54..84.54 rows=2954 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..84.54 rows=2954 width=12)