Aggregate (cost=163.58..163.61 rows=1 width=699) -> Group (cost=163.58..163.60 rows=1 width=699) -> Sort (cost=163.58..163.58 rows=1 width=699) Sort Key: m.group_code, m.sku, m.brn_code, m.stktype_code, ss.supplier_price_curr_cost, sk.sku_price_curr_cost -> Nested Loop (cost=115.56..163.57 rows=1 width=699) Join Filter: (("outer".sku = "inner".sku) AND ("outer".group_code = "inner".group_code)) -> Nested Loop (cost=115.56..157.53 rows=1 width=635) Join Filter: (("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg) AND ("inner".group_cde = "outer".group_cde)) -> Nested Loop (cost=115.56..152.49 rows=1 width=517) Join Filter: (("inner".group_cde = "outer".group_cde) AND ("inner".price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND ("inner".price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Hash Join (cost=115.56..147.45 rows=1 width=367) Hash Cond: ("outer".branch_cde = "inner".brn_code) Join Filter: ("inner".group_code = "outer".group_cde) -> Seq Scan on price_tmpl_det p (cost=0.00..20.00 rows=1000 width=100) -> Hash (cost=115.49..115.49 rows=25 width=267) -> Nested Loop (cost=0.00..115.49 rows=25 width=267) -> Nested Loop (cost=0.00..11.50 rows=1 width=115) -> Index Scan using forex_idx1 on forex f (cost=0.00..5.71 rows=1 width=51) Index Cond: ((to_ctry = 'ZAF'::text) AND (fpp_code = '200307'::text)) -> Index Scan using master_branch_descr_idx4 on master_branch_descr b (cost=0.00..5.78 rows=1 width=64) Index Cond: (b.country_code = "outer".from_ctry) -> Index Scan using master_fpp_values_uidx1 on master_fpp_values m (cost=0.00..103.68 rows=25 width=152) Index Cond: ((m.fpp_code = '200307'::text) AND (m.brn_code = "outer".brn_code)) -> Index Scan using pk_supplier_price on supplier_price ss (cost=0.00..5.02 rows=1 width=150) Index Cond: ((ss.group_cde = "outer".group_code) AND (ss.sku_mst_cde = "outer".sku) AND (ss.supplier_cde = "outer".supplier_code)) -> Index Scan using idx_sku_price on sku_price sk (cost=0.00..5.02 rows=1 width=118) Index Cond: ((sk.group_cde = "outer".group_cde) AND (sk.sku_mst_cde = "outer".sku_mst_cde) AND (sk.price_tmpl_hdr_cde = "outer".price_tmpl_hdr_cde) AND (sk.price_tmpl_hdr_reg = "outer".price_tmpl_hdr_reg)) -> Index Scan using master_sku_descr_idx1 on master_sku_descr s (cost=0.00..6.02 rows=1 width=64) Index Cond: (("outer".group_cde = s.group_code) AND ("outer".sku_mst_cde = s.sku) AND (s.control_code = '0'::text)) (29 rows)