QUERY PLAN
Aggregate (cost=141.96..141.97 rows=1 width=8)
-> Sort (cost=141.94..141.95 rows=1 width=238)
Sort Key: r.verify_at DESC NULLS LAST
-> Group (cost=141.93..141.93 rows=1 width=238)
Group Key: r.id
-> Sort (cost=141.93..141.93 rows=1 width=12)
Sort Key: r.id
-> Hash Right Join (cost=93.61..141.92 rows=1 width=12)
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=93.60..93.60 rows=1 width=12)
-> Seq Scan on tbl_erp_ticket_change_logs r (cost=0.00..93.60 rows=1 width=12)
Filter: (ticket_type = '20032'::smallint)