"QUERY PLAN" "Sort (cost=6076136.50..6076232.05 rows=38220 width=207) (actual time=19624.893..20198.218 rows=306002 loops=1)" " Sort Key: ap.m_offer_product_id" " Sort Method: external merge Disk: 53928kB" " -> Nested Loop (cost=1.69..6069437.06 rows=38220 width=207) (actual time=0.611..17767.212 rows=306002 loops=1)" " -> Nested Loop (cost=1.27..6043422.86 rows=38232 width=179) (actual time=0.542..15351.445 rows=306002 loops=1)" " -> Nested Loop (cost=0.84..6021244.95 rows=38250 width=144) (actual time=0.488..12970.312 rows=306002 loops=1)" " -> Nested Loop (cost=0.42..5996772.15 rows=38247 width=68) (actual time=0.439..10576.370 rows=306007 loops=1)" " -> Seq Scan on m_offer mo (cost=0.00..714759.63 rows=229535 width=35) (actual time=0.078..58.090 rows=306047 loops=1)" " Filter: ((NOT (hashed SubPlan 2)) OR (hashed SubPlan 4))" " SubPlan 2" " -> Seq Scan on m_offer_pricelist pl_1 (cost=0.00..1.12 rows=1 width=32) (actual time=0.013..0.016 rows=2 loops=2)" " Filter: (((m_pricelist_id)::text = '496CF965DF9744D2A41248392D1DE407'::text) AND (isactive = 'Y'::bpchar))" " Rows Removed by Filter: 6" " SubPlan 4" " -> Seq Scan on m_offer_pricelist pl_2 (cost=0.00..1.12 rows=1 width=32) (actual time=0.005..0.006 rows=2 loops=1)" " Filter: (((m_pricelist_id)::text = '496CF965DF9744D2A41248392D1DE407'::text) AND (isactive = 'Y'::bpchar))" " Rows Removed by Filter: 6" " -> Index Scan using m_offer_key on m_offer p_1 (cost=0.42..23.00 rows=1 width=35) (actual time=0.034..0.034 rows=1 loops=306047)" " Index Cond: ((m_offer_id)::text = (mo.m_offer_id)::text)" " Filter: (((em_obdisc_c_currency_id IS NULL) OR ((em_obdisc_c_currency_id)::text = '102'::text)) AND ((ad_client_id)::text = '39363B0921BB4293B48383844325E84C'::text) AND ((ad_org_id)::text = '0'::text) AND ((((pricelist_selection)::text = 'Y'::text) AND (NOT (hashed SubPlan 2))) OR (((pricelist_selection)::text = 'N'::text) AND (hashed SubPlan 4))) AND ((((org_selection)::text = 'Y'::text) AND (NOT (hashed SubPlan 7))) OR (((org_selection)::text = 'N'::text) AND (hashed SubPlan 9))) AND (((product_selection)::text = 'Y'::text) OR (((product_selection)::text = 'N'::text) AND (SubPlan 5))))" " Rows Removed by Filter: 0" " SubPlan 7" " -> Seq Scan on m_offer_organization o (cost=0.00..1.21 rows=1 width=32) (actual time=0.018..0.019 rows=1 loops=1)" " Filter: ((startdate IS NULL) AND (enddate IS NULL) AND ((ad_org_id)::text = 'D270A5AC50874F8BA67A88EE977F8E3B'::text) AND (isactive = 'Y'::bpchar))" " SubPlan 9" " -> Seq Scan on m_offer_organization o_1 (cost=0.00..1.21 rows=1 width=32) (never executed)" " Filter: (((ad_org_id)::text = 'D270A5AC50874F8BA67A88EE977F8E3B'::text) AND (isactive = 'Y'::bpchar))" " SubPlan 5" " -> Nested Loop (cost=1.27..17.48 rows=1 width=0) (actual time=0.025..0.025 rows=1 loops=306002)" " Join Filter: ((pop.m_product_id)::text = (ppl.m_product_id)::text)" " -> Nested Loop (cost=0.84..16.88 rows=1 width=66) (actual time=0.017..0.017 rows=1 loops=306002)" " -> Index Scan using m_offerproduct_offer_idx on m_offer_product pop (cost=0.42..8.44 rows=1 width=33) (actual time=0.008..0.008 rows=1 loops=306002)" " Index Cond: ((m_offer_id)::text = (p_1.m_offer_id)::text)" " -> Index Scan using m_product_key on m_product pm (cost=0.42..8.44 rows=1 width=33) (actual time=0.008..0.008 rows=1 loops=306002)" " Index Cond: ((m_product_id)::text = (pop.m_product_id)::text)" " Filter: (isactive = 'Y'::bpchar)" " -> Index Scan using obretco_mproduct_index on obretco_prol_product ppl (cost=0.42..0.58 rows=1 width=33) (actual time=0.008..0.008 rows=1 loops=306002)" " Index Cond: ((m_product_id)::text = (pm.m_product_id)::text)" " Filter: (((obretco_productlist_id)::text = 'A09F7C5B7B8947D4A9103E4A289C2A79'::text) AND (isactive = 'Y'::bpchar))" " -> Index Scan using m_offerproduct_offer_idx on m_offer_product ap (cost=0.42..0.63 rows=1 width=142) (actual time=0.008..0.008 rows=1 loops=306007)" " Index Cond: ((m_offer_id)::text = (mo.m_offer_id)::text)" " -> Index Scan using obretco_mproduct_index on obretco_prol_product pl (cost=0.42..0.58 rows=1 width=35) (actual time=0.008..0.008 rows=1 loops=306002)" " Index Cond: ((m_product_id)::text = (ap.m_product_id)::text)" " Filter: ((obretco_productlist_id)::text = 'A09F7C5B7B8947D4A9103E4A289C2A79'::text)" " -> Index Scan using m_product_key on m_product p (cost=0.42..0.67 rows=1 width=71) (actual time=0.008..0.008 rows=1 loops=306002)" " Index Cond: ((m_product_id)::text = (ap.m_product_id)::text)" "Planning Time: 10.075 ms" "Execution Time: 20212.298 ms"