QUERY PLAN
Aggregate (cost=201.68..201.69 rows=1 width=8)
-> Sort (cost=180.32..183.88 rows=1424 width=238)
Sort Key: r.created_at DESC
-> HashAggregate (cost=91.49..105.73 rows=1424 width=238)
Group Key: r.id
-> Hash Right Join (cost=58.04..87.93 rows=1424 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..26.58 rows=1258 width=4)
-> Hash (cost=40.24..40.24 rows=1424 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..40.24 rows=1424 width=12)