QUERY PLAN
Aggregate (cost=425.66..425.67 rows=1 width=8)
-> Sort (cost=381.01..388.45 rows=2977 width=238)
Sort Key: r.verify_at DESC NULLS LAST
-> HashAggregate (cost=179.47..209.24 rows=2977 width=238)
Group Key: r.id
-> Hash Right Join (cost=121.98..172.03 rows=2977 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..42.75 rows=2775 width=4)
-> Hash (cost=84.77..84.77 rows=2977 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..84.77 rows=2977 width=12)