Following is the query plan before optimization:

FINE: Logical Plan:
distribute result [%0->$$32] -- |UNPARTITIONED|
  unnest $$32 <- function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
      %0->$$31
    ] -- |UNPARTITIONED|
    subplan {
              aggregate [$$31] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
                  %0->$$30
                ]] -- |UNPARTITIONED|
                assign [$$30] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
Args:[
                    %0->$$29
                  ]] -- |UNPARTITIONED|
                  subplan {
                            aggregate [$$29] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[
                                %0->$$26
                              ]] -- |UNPARTITIONED|
                              subplan {
                                        select (function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}if-then-else, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}instance-of <{
http://www.w3.org/2001/XMLSchema-extensions}numeric >, Args:[
                                                %0->$$28
                                              ]
                                            function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}value-eq, Args:[
                                                %0->$$28
                                                %0->$$27
                                              ]
                                            function-call: vxquery:{
http://www.w3.org/2005/xpath-functions}boolean, Args:[
                                                %0->$$28
                                              ]
                                          ]) -- |UNPARTITIONED|
                                          assign [$$28] <- [{
http://www.w3.org/2001/XMLSchema}integer : 1] -- |UNPARTITIONED|
                                            unnest $$26 at $$27 <-
function-call: vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                                                %0->$$24
                                              ] -- |UNPARTITIONED|
                                              assign [$$25] <-
[function-call: vxquery:{http://www.w3.org/2005/xpath-functions}count,
Args:[
                                                  %0->$$24
                                                ]] -- |UNPARTITIONED|
                                                assign [$$24] <-
[function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}child
<element(NameTest({}bidder, {http://www.w3.org/2001/XMLSchema}anyType,
nilled) >, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
                                                            %0->$$22
                                                          ]
                                                      ]
                                                  ]] -- |UNPARTITIONED|
                                                  nested tuple source --
|UNPARTITIONED|
                                     } -- |UNPARTITIONED|
                                unnest $$22 at $$23 <- function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                                    %0->$$20
                                  ] -- |UNPARTITIONED|
                                  assign [$$21] <- [function-call: vxquery:{
http://www.w3.org/2005/xpath-functions}count, Args:[
                                      %0->$$20
                                    ]] -- |UNPARTITIONED|
                                    nested tuple source -- |UNPARTITIONED|
                         } -- |UNPARTITIONED|
                    assign [$$20] <-
[vxquery:{urn:org.apache.vxquery.operators-ext}treat <item >, Args:[
                        %0->$$19
                      ]] -- |UNPARTITIONED|
                      unnest $$19 <- function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                          %0->$$18
                        ] -- |UNPARTITIONED|
                        assign [$$18] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
Args:[
                            %0->$$17
                          ]] -- |UNPARTITIONED|
                          subplan {
                                    aggregate [$$17] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}child
<element(NameTest({}open_auction, {http://www.w3.org/2001/XMLSchema}anyType,
nilled) >, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
                                                %0->$$15
                                              ]
                                          ]
                                      ]] -- |UNPARTITIONED|
                                      unnest $$15 at $$16 <- function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                                          %0->$$13
                                        ] -- |UNPARTITIONED|
                                        assign [$$14] <- [function-call:
vxquery:{http://www.w3.org/2005/xpath-functions}count, Args:[
                                            %0->$$13
                                          ]] -- |UNPARTITIONED|
                                          assign [$$13] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
Args:[
                                              %0->$$12
                                            ]] -- |UNPARTITIONED|
                                            nested tuple source --
|UNPARTITIONED|
                                 } -- |UNPARTITIONED|
                            subplan {
                                      aggregate [$$12] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}child
<element(NameTest({}open_auctions, {http://www.w3.org/2001/XMLSchema}anyType,
nilled) >, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
                                                  %0->$$10
                                                ]
                                            ]
                                        ]] -- |UNPARTITIONED|
                                        unnest $$10 at $$11 <-
function-call: vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                                            %0->$$8
                                          ] -- |UNPARTITIONED|
                                          assign [$$9] <- [function-call:
vxquery:{http://www.w3.org/2005/xpath-functions}count, Args:[
                                              %0->$$8
                                            ]] -- |UNPARTITIONED|
                                            assign [$$8] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
Args:[
                                                %0->$$7
                                              ]] -- |UNPARTITIONED|
                                              nested tuple source --
|UNPARTITIONED|
                                   } -- |UNPARTITIONED|
                              subplan {
                                        aggregate [$$7] <- [function-call:
vxquery:{urn:org.apache.vxquery.operators-ext}sequence, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}child
<element(NameTest({}site, {http://www.w3.org/2001/XMLSchema}anyType,
nilled) >, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
                                                    %0->$$5
                                                  ]
                                              ]
                                          ]] -- |UNPARTITIONED|
                                          unnest $$5 at $$6 <-
function-call: vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
                                              %0->$$3
                                            ] -- |UNPARTITIONED|
                                            assign [$$4] <- [function-call:
vxquery:{http://www.w3.org/2005/xpath-functions}count, Args:[
                                                %0->$$3
                                              ]] -- |UNPARTITIONED|
                                              nested tuple source --
|UNPARTITIONED|
                                     } -- |UNPARTITIONED|
                                assign [$$3] <- [function-call: vxquery:{
http://www.w3.org/2005/xpath-functions}doc, Args:[

vxquery:{urn:org.apache.vxquery.operators-ext}promote <{
http://www.w3.org/2001/XMLSchema}string?>, Args:[
                                        function-call: vxquery:{
http://www.w3.org/2005/xpath-functions}data, Args:[
                                            %0->$$2
                                          ]
                                      ]
                                  ]] -- |UNPARTITIONED|
                                  assign [$$2] <-
[vxquery:{urn:org.apache.vxquery.operators-ext}treat <item*>, Args:[
                                      %0->$$1
                                    ]] -- |UNPARTITIONED|
                                    assign [$$1] <- [{
http://www.w3.org/2001/XMLSchema}string : open_auctions.xml] --
|UNPARTITIONED|
                                      nested tuple source -- |UNPARTITIONED|
           } -- |UNPARTITIONED|
      empty-tuple-source -- |UNPARTITIONED|


On Mon, Jul 13, 2015 at 10:37 AM, Shivani Mall <[email protected]> wrote:

> That was the query plan after optimization.
>
> On Mon, Jul 13, 2015 at 10:33 AM, Shivani Mall <[email protected]> wrote:
>
>> Here is the query plan:
>>
>>   exchange
>>   -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
>>     unnest $$32 <- function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
>>         %0->$$26
>>       ]
>>     -- UNNEST  |UNPARTITIONED|
>>       subplan {
>>                 select (function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}if-then-else, Args:[
>>
>> vxquery:{urn:org.apache.vxquery.operators-ext}instance-of <{
>> http://www.w3.org/2001/XMLSchema-extensions}numeric >, Args:[
>>                         {http://www.w3.org/2001/XMLSchema}integer : 1
>>                       ]
>>                     function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}value-eq, Args:[
>>                         {http://www.w3.org/2001/XMLSchema}integer : 1
>>                         %0->$$27
>>                       ]
>>                     function-call: vxquery:{
>> http://www.w3.org/2005/xpath-functions}boolean, Args:[
>>                         {http://www.w3.org/2001/XMLSchema}integer : 1
>>                       ]
>>                   ])
>>                 -- STREAM_SELECT  |UNPARTITIONED|
>>                   unnest $$26 at $$27 <- function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
>>                       %0->$$24
>>                     ]
>>                   -- UNNEST  |UNPARTITIONED|
>>                     assign [$$24] <- [function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}sort-distinct-nodes-asc-or-atomics,
>> Args:[
>>
>> vxquery:{urn:org.apache.vxquery.operators-ext}child
>> <element(NameTest({}bidder, {http://www.w3.org/2001/XMLSchema}anyType,
>> nilled) >, Args:[
>>
>> vxquery:{urn:org.apache.vxquery.operators-ext}treat <node*>, Args:[
>>                                 %0->$$22
>>                               ]
>>                           ]
>>                       ]]
>>                     -- ASSIGN  |UNPARTITIONED|
>>                       nested tuple source
>>                       -- NESTED_TUPLE_SOURCE  |UNPARTITIONED|
>>              }
>>       -- SUBPLAN  |UNPARTITIONED|
>>         unnest $$22 <- function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
>>             %0->$$19
>>           ]
>>         -- UNNEST  |UNPARTITIONED|
>>           unnest $$19 <-
>> vxquery:{urn:org.apache.vxquery.operators-ext}child
>> <element(NameTest({}open_auction, {
>> http://www.w3.org/2001/XMLSchema}anyType, nilled) >, Args:[
>>               %0->$$15
>>             ]
>>           -- UNNEST  |UNPARTITIONED|
>>             unnest $$15 <-
>> vxquery:{urn:org.apache.vxquery.operators-ext}child
>> <element(NameTest({}open_auctions, {
>> http://www.w3.org/2001/XMLSchema}anyType, nilled) >, Args:[
>>                 %0->$$10
>>               ]
>>             -- UNNEST  |UNPARTITIONED|
>>               unnest $$10 <-
>> vxquery:{urn:org.apache.vxquery.operators-ext}child
>> <element(NameTest({}site, {http://www.w3.org/2001/XMLSchema}anyType,
>> nilled) >, Args:[
>>                   vxquery:{urn:org.apache.vxquery.operators-ext}treat
>> <node*>, Args:[
>>                       %0->$$5
>>                     ]
>>                 ]
>>               -- UNNEST  |UNPARTITIONED|
>>                 unnest $$5 <- function-call:
>> vxquery:{urn:org.apache.vxquery.operators-ext}iterate, Args:[
>>                     %0->$$3
>>                   ]
>>                 -- UNNEST  |UNPARTITIONED|
>>                   assign [$$3] <- [function-call: vxquery:{
>> http://www.w3.org/2005/xpath-functions}doc, Args:[
>>                       {http://www.w3.org/2001/XMLSchema}string :
>> open_auctions.xml
>>                     ]]
>>                   -- ASSIGN  |UNPARTITIONED|
>>                     empty-tuple-source
>>                     -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
>>
>>
>> On Fri, Jul 10, 2015 at 9:12 PM, Eldon Carman <[email protected]> wrote:
>>
>>> I believe the expression can be removed even from your example query. The
>>> query must be able to pick out the position item in question. The query
>>> plan should have a positional variable added by default to the query
>>> plan.
>>> Could you post the query plan before and after optimization?
>>>
>>
>>
>

Reply via email to