QUERY PLAN
Aggregate (cost=1396.18..1396.19 rows=1 width=32)
-> Nested Loop (cost=7.70..1396.18 rows=2 width=5)
-> Hash Join (cost=7.41..1386.45 rows=6 width=9)
Hash Cond: (dt1.taxonomy_id = tt.id)
-> Seq Scan on tbl_term_taxonomy_relationships dt1 (cost=0.00..1374.76 rows=1602 width=13)
Filter: ((term_id = 18) AND (object_type = 11))
-> Hash (cost=7.40..7.40 rows=1 width=4)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..7.40 rows=1 width=4)
Filter: ((serial_no)::text = '221106'::text)
-> Index Scan using tbl_erp_cash_cost_tickets_pkey on tbl_erp_cash_cost_tickets t (cost=0.28..1.62 rows=1 width=4)
Index Cond: (id = dt1.object_id)
Filter: ((settle_amount < amount) AND (status = 2))