QUERY PLAN
Limit (cost=304.67..304.77 rows=40 width=126)
-> Sort (cost=304.67..312.19 rows=3008 width=126)
Sort Key: r.verify_at
-> HashAggregate (cost=179.50..209.58 rows=3008 width=126)
Group Key: r.id
-> Hash Right Join (cost=123.68..171.98 rows=3008 width=126)
Hash Cond: (rvr.erp_ticket_change_log_id = r.id)
-> Seq Scan on tbl_erp_ticket_change_log_handlers rvr (cost=0.00..41.37 rows=2637 width=4)
-> Hash (cost=86.08..86.08 rows=3008 width=126)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..86.08 rows=3008 width=126)