QUERY PLAN
Aggregate (cost=1401.04..1401.05 rows=1 width=32)
-> Nested Loop (cost=8.07..1401.04 rows=2 width=5)
-> Hash Join (cost=7.79..1394.41 rows=6 width=9)
Hash Cond: (dt1.taxonomy_id = tt.id)
-> Seq Scan on tbl_term_taxonomy_relationships dt1 (cost=0.00..1381.69 rows=1853 width=13)
Filter: ((term_id = 18) AND (object_type = 11))
-> Hash (cost=7.78..7.78 rows=1 width=4)
-> Seq Scan on tbl_term_taxonomies tt (cost=0.00..7.78 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.10 rows=1 width=4)
Index Cond: (id = dt1.object_id)
Filter: ((settle_amount < amount) AND (status = 2))