'Sort (cost=520093.06..520093.56 rows=200 width=592)' ' Sort Key: (to_char(((ad_column_identifier('M_Product'::character varying, to_char(m_product.m_product_id), 'en_US'::character varying))::text || (CASE WHEN (c_uom.uomsymbol IS NULL) THEN ''::character varying ELSE to_char(((' ('::text || (c_uom.uomsymbol)::text) || ')'::text)) END)::text)))' ' -> HashAggregate (cost=519980.92..520085.42 rows=200 width=592)' ' -> HashAggregate (cost=518910.88..519898.98 rows=964 width=574)' ' -> Sort (cost=518043.28..518067.38 rows=9640 width=296)' ' Sort Key: (to_char(((ad_column_identifier('M_Product'::character varying, to_char(m_product.m_product_id), 'en_US'::character varying))::text || (CASE WHEN (c_uom.uomsymbol IS NULL) THEN ''::character varying ELSE to_char(((' ('::text || (c_uom.uomsymbol)::text) || ')'::text)) END)::text)))' ' -> Merge Right Join (cost=453544.61..517405.36 rows=9640 width=296)' ' Merge Cond: ((m_transaction_cost.m_transaction_id)::text = (trx.m_transaction_id)::text)' ' -> GroupAggregate (cost=258011.68..284450.72 rows=1194097 width=43)' ' -> Sort (cost=258011.68..261636.20 rows=1449807 width=43)' ' Sort Key: m_transaction_cost.m_transaction_id, m_transaction_cost.c_currency_id' ' -> Seq Scan on m_transaction_cost (cost=0.00..65042.07 rows=1449807 width=43)' ' -> Sort (cost=195532.93..195557.03 rows=9640 width=293)' ' Sort Key: trx.m_transaction_id' ' -> Nested Loop Left Join (cost=353.47..194895.01 rows=9640 width=293)' ' -> Nested Loop Left Join (cost=353.04..188707.39 rows=9640 width=214)' ' -> Hash Left Join (cost=352.49..180908.33 rows=9640 width=214)' ' Hash Cond: ((c_invoiceline.c_uom_id)::text = (c_uom.c_uom_id)::text)' ' -> Nested Loop Left Join (cost=350.99..180774.28 rows=9640 width=219)' ' -> Hash Left Join (cost=350.57..176305.83 rows=9640 width=212)' ' Hash Cond: ((c_invoice.c_doctype_id)::text = (c_doctype.c_doctype_id)::text)' ' -> Nested Loop (cost=35.19..175809.70 rows=9640 width=239)' ' -> Hash Join (cost=34.64..27818.10 rows=2499 width=109)' ' Hash Cond: ((c_invoice.ad_org_id)::text = (ad_org.ad_org_id)::text)' ' -> Nested Loop (cost=0.98..27750.08 rows=2499 width=110)' ' -> Seq Scan on c_bp_group (cost=0.00..1.19 rows=1 width=82)' ' Filter: ((c_bp_group_id)::text = '21FE15587FE048D4B898272F4D44176A'::text)' ' -> Nested Loop (cost=0.98..27723.90 rows=2499 width=143)' ' -> Index Scan using c_invoice_client_org_date_doc on c_invoice (cost=0.56..7096.37 rows=3155 width=257)' ' Index Cond: (((ad_client_id)::text = ANY ('{0,101C8C9C4A8D4C84857E3F5FBD722757}'::text[])) AND ((ad_org_id)::text = ANY ('{C002170F73544C6E9AAEC8DD7FBB5750,0A733B3F5292414BA2310836A3EE9B73,664FFE8B17974ABCBE4215D77996BB16,AA6E6D54ACC94E3DA142B1CA42C332E6,E168567EAFF94B4793996B0AB415930B,24D0809B7ACB4BEEBFD742E6D3BF1004,61D784C8E7B24C61864CAAC67AC3554F,9F488865B7FF4341938EBA9D94204795,2A85B2F756EA492897FA0C5061D35C04,33DD7E752F9E4370AAE84B7B6B1EA5AD}'::text[])) AND (dateinvoiced >= '2017-04-01 00:00:00'::timestamp without time zone) AND (dateinvoiced < '2017-06-01 00:00:00'::timestamp without time zone))' ' Filter: ((issotrx = 'Y'::bpchar) AND (processed = 'Y'::bpchar))' ' -> Index Scan using c_bpartner_idsalesrep on c_bpartner (cost=0.42..6.53 rows=1 width=99)' ' Index Cond: ((c_bpartner_id)::text = (c_invoice.c_bpartner_id)::text)' ' Filter: ((c_bp_group_id)::text = '21FE15587FE048D4B898272F4D44176A'::text)' ' -> Hash (cost=31.21..31.21 rows=196 width=32)' ' -> Index Only Scan using ad_org_key on ad_org (cost=0.27..31.21 rows=196 width=32)' ' -> Index Scan using c_invoiceline_invoice on c_invoiceline (cost=0.55..59.06 rows=16 width=196)' ' Index Cond: ((c_invoice_id)::text = (c_invoice.c_invoice_id)::text)' ' -> Hash (cost=256.28..256.28 rows=4728 width=37)' ' -> Seq Scan on c_doctype (cost=0.00..256.28 rows=4728 width=37)' ' -> Index Scan using m_product_key on m_product (cost=0.42..0.45 rows=1 width=73)' ' Index Cond: ((c_invoiceline.m_product_id)::text = (m_product_id)::text)' ' -> Hash (cost=1.22..1.22 rows=22 width=98)' ' -> Seq Scan on c_uom (cost=0.00..1.22 rows=22 width=98)' ' -> Index Scan using m_inoutline_key on m_inoutline (cost=0.55..0.80 rows=1 width=66)' ' Index Cond: ((c_invoiceline.m_inoutline_id)::text = (m_inoutline_id)::text)' ' -> Index Scan using m_transaction_inoutline on m_transaction trx (cost=0.43..0.63 rows=1 width=145)' ' Index Cond: ((m_inoutline_id)::text = (m_inoutline.m_inoutline_id)::text)'