QUERY PLAN
Aggregate (cost=63.29..63.30 rows=1 width=8)
-> Sort (cost=56.01..57.22 rows=485 width=238)
Sort Key: r.created_at DESC
-> HashAggregate (cost=29.53..34.38 rows=485 width=238)
Group Key: r.id
-> Hash Right Join (cost=19.91..28.31 rows=485 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..7.27 rows=427 width=4)
-> Hash (cost=13.85..13.85 rows=485 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..13.85 rows=485 width=12)