QUERY PLAN
Limit (cost=71.37..71.37 rows=1 width=245)
-> Sort (cost=71.37..71.37 rows=1 width=245)
Sort Key: r.created_at DESC
-> Group (cost=71.35..71.36 rows=1 width=245)
Group Key: r.id
-> Sort (cost=71.35..71.36 rows=1 width=245)
Sort Key: r.id
-> Hash Right Join (cost=47.99..71.34 rows=1 width=245)
Hash Cond: (rvr.erp_payment_ticket_id = r.id)
-> Seq Scan on tbl_erp_payment_ticket_verify_rels rvr (cost=0.00..19.70 rows=970 width=4)
-> Hash (cost=47.98..47.98 rows=1 width=245)
-> Nested Loop (cost=0.28..47.98 rows=1 width=245)
-> Seq Scan on tbl_erp_payment_ticket_settles eptss (cost=0.00..39.67 rows=1 width=4)
Filter: (purchase_contract_id = 4072)
-> Index Scan using tbl_erp_payment_tickets_pkey on tbl_erp_payment_tickets r (cost=0.28..8.30 rows=1 width=245)
Index Cond: (id = eptss.erp_payment_ticket_id)