QUERY PLAN
Aggregate (cost=86.36..86.37 rows=1 width=8)
-> Sort (cost=76.58..78.21 rows=652 width=238)
Sort Key: r.created_at DESC
-> HashAggregate (cost=39.58..46.10 rows=652 width=238)
Group Key: r.id
-> Hash Right Join (cost=26.67..37.95 rows=652 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..9.76 rows=576 width=4)
-> Hash (cost=18.52..18.52 rows=652 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..18.52 rows=652 width=12)