QUERY PLAN
Limit (cost=50.75..50.80 rows=20 width=107)
-> Sort (cost=50.75..52.06 rows=525 width=107)
Sort Key: r.created_at DESC
-> HashAggregate (cost=31.53..36.78 rows=525 width=107)
Group Key: r.id
-> Hash Right Join (cost=21.81..30.21 rows=525 width=107)
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=15.25..15.25 rows=525 width=107)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..15.25 rows=525 width=107)