QUERY PLAN
GroupAggregate (cost=15.20..15.24 rows=1 width=93)
Group Key: t.id, e.id, b.serial_no
-> Sort (cost=15.20..15.20 rows=1 width=93)
Sort Key: b.serial_no
-> Nested Loop Left Join (cost=1.19..15.19 rows=1 width=93)
Join Filter: (b.id = e.erp_bank_id)
-> Nested Loop (cost=1.19..13.94 rows=1 width=87)
-> Nested Loop Left Join (cost=1.19..12.39 rows=1 width=65)
Join Filter: (h.erp_other_income_ticket_id = t.id)
-> Seq Scan on tbl_erp_other_income_tickets t (cost=0.00..3.20 rows=1 width=57)
Filter: ((verify_at IS NOT NULL) AND (id = 37) AND (status = 2))
-> Hash Right Join (cost=1.19..9.18 rows=1 width=12)
Hash Cond: (u.id = h.user_id)
-> Seq Scan on tbl_users u (cost=0.00..7.44 rows=144 width=8)
-> Hash (cost=1.18..1.18 rows=1 width=8)
-> Seq Scan on tbl_erp_other_income_ticket_handlers h (cost=0.00..1.18 rows=1 width=8)
Filter: (erp_other_income_ticket_id = 37)
-> Seq Scan on tbl_erp_other_income_ticket_bank_ins e (cost=0.00..1.54 rows=1 width=26)
Filter: ((settle_at IS NOT NULL) AND (amount > '0'::numeric) AND (erp_other_income_ticket_id = 37) AND (id = 42))
-> Seq Scan on tbl_erp_banks b (cost=0.00..1.11 rows=11 width=10)