QUERY PLAN
Limit (cost=150.75..150.85 rows=40 width=114)
-> Sort (cost=150.75..154.31 rows=1424 width=114)
Sort Key: r.created_at DESC
-> HashAggregate (cost=91.49..105.73 rows=1424 width=114)
Group Key: r.id
-> Hash Right Join (cost=58.04..87.93 rows=1424 width=114)
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=114)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..40.24 rows=1424 width=114)