QUERY PLAN
Limit (cost=86.46..86.56 rows=37 width=114)
-> Sort (cost=86.46..86.56 rows=37 width=114)
Sort Key: r.created_at DESC
-> HashAggregate (cost=85.13..85.50 rows=37 width=114)
Group Key: r.id
-> Hash Join (cost=30.19..85.04 rows=37 width=114)
Hash Cond: (r.id = rvr.erp_ticket_change_log_id)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..40.24 rows=1424 width=114)
-> Hash (cost=29.73..29.73 rows=37 width=4)
-> Seq Scan on tbl_erp_ticket_change_log_handlers rvr (cost=0.00..29.73 rows=37 width=4)
Filter: (user_id = 5388)