QUERY PLAN
Limit (cost=303.34..303.44 rows=40 width=122)
-> Sort (cost=303.34..310.78 rows=2977 width=122)
Sort Key: r.verify_at DESC NULLS LAST
-> HashAggregate (cost=179.47..209.24 rows=2977 width=122)
Group Key: r.id
-> Hash Right Join (cost=121.98..172.03 rows=2977 width=122)
Hash Cond: (rvr.erp_ticket_change_log_id = r.id)
-> Seq Scan on tbl_erp_ticket_change_log_handlers rvr (cost=0.00..42.75 rows=2775 width=4)
-> Hash (cost=84.77..84.77 rows=2977 width=122)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..84.77 rows=2977 width=122)