QUERY PLAN
Limit (cost=89.80..89.90 rows=40 width=114)
-> Sort (cost=89.80..90.01 rows=84 width=114)
Sort Key: r.created_at DESC
-> HashAggregate (cost=86.31..87.15 rows=84 width=114)
Group Key: r.id
-> Hash Join (cost=30.78..86.10 rows=84 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=84 width=4)
-> Seq Scan on tbl_erp_ticket_change_log_handlers rvr (cost=0.00..29.73 rows=84 width=4)
Filter: (user_id = 1001)