Nested Loop Left Join (cost=6.13..550.68 rows=12 width=621) (actual rows=0.00 loops=1) -> Hash Left Join (cost=5.69..448.92 rows=12 width=515) (actual rows=0.00 loops=1) Hash Cond: (pl.tax_id = tc.tax_id) -> Nested Loop Left Join (cost=1.72..444.91 rows=12 width=407) (actual rows=0.00 loops=1) -> Nested Loop (cost=0.86..241.66 rows=12 width=209) (actual rows=0.00 loops=1) -> Index Scan using ix_pricelist_options_1 on pricelist_options pl (cost=0.43..80.90 rows=19 width=106) (actual rows=165.00 loops=1) Index Cond: ((brand_id = 10) AND ((line_code)::text = 'ABC'::text) AND ((model_year)::text = 'YR'::text) AND ((model_code)::text = 'ABC'::text) AND ((version_code)::text = 'VER-001'::text) AND (pricelist_id = 100)) Index Searches: 1 -> Index Scan using pk_product_options on product_options po (cost=0.43..8.46 rows=1 width=103) (actual rows=0.00 loops=165) Index Cond: ((brand_id = 10) AND ((line_code)::text = 'ABC'::text) AND ((model_year)::text = 'YR'::text) AND ((model_code)::text = 'ABC'::text) AND ((version_code)::text = 'VER-001'::text) AND ((option_type)::text = (pl.option_type)::text) AND ((option_code)::text = (pl.option_code)::text)) Index Searches: 165 -> Nested Loop Left Join (cost=0.85..16.93 rows=1 width=198) (never executed) -> Index Scan using pk_option_rules on option_rules rules (cost=0.42..8.46 rows=1 width=95) (never executed) Index Cond: ((brand_id = 10) AND ((line_code)::text = 'ABC'::text) AND ((model_year)::text = 'YR'::text) AND ((model_code)::text = 'ABC'::text) AND ((version_code)::text = 'VER-001'::text) AND ((option_type)::text = (pl.option_type)::text) AND ((option_code)::text = (pl.option_code)::text)) Index Searches: 0 -> Index Scan using pk_product_options on product_options po2 (cost=0.43..8.46 rows=1 width=103) (never executed) Index Cond: ((brand_id = 10) AND ((line_code)::text = 'ABC'::text) AND ((model_year)::text = 'YR'::text) AND ((model_code)::text = 'ABC'::text) AND ((version_code)::text = 'VER-001'::text) AND ((option_type)::text = (rules.sec_option_type)::text) AND ((option_code)::text = (rules.sec_option_code)::text)) Index Searches: 0 -> Hash (cost=2.88..2.88 rows=88 width=108) (never executed) -> Seq Scan on tax_codes tc (cost=0.00..2.88 rows=88 width=108) (never executed) -> Index Scan using ix_pricelist_options_1 on pricelist_options pl_check (cost=0.43..8.47 rows=1 width=106) (never executed) Index Cond: ((brand_id = rules.brand_id) AND ((line_code)::text = (rules.line_code)::text) AND ((model_year)::text = (rules.model_year)::text) AND ((model_code)::text = (rules.model_code)::text) AND ((version_code)::text = (rules.version_code)::text) AND (pricelist_id = 100)) Filter: (((option_type)::text = (rules.sec_option_type)::text) AND ((option_code)::text = (rules.sec_option_code)::text)) Index Searches: 0 Planning Time: 5.456 ms Execution Time: 2.272 ms