QUERY PLAN
Aggregate (cost=91.09..91.10 rows=1 width=8)
-> Sort (cost=89.83..90.04 rows=84 width=238)
Sort Key: r.created_at DESC
-> HashAggregate (cost=86.31..87.15 rows=84 width=238)
Group Key: r.id
-> Hash Join (cost=30.78..86.10 rows=84 width=12)
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=12)
-> 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)