Clone
Yingyi Bu <buyingyi@gmail.com>
committed
on 16 Jun 15
AsterixDB changes for fixing issue873.
For example, in the following query plan, the change lets the optimizer recognize that $12 and $20 ar… Show more
AsterixDB changes for fixing issue873.

For example, in the following query plan, the change lets the optimizer recognize that $12 and $20 are equivalent.

Therefore, HASH_PARTITION_EXCHANGE [$$12] can be replaced by ONE_TO_ONE_EXCHANGE.

-- COMMIT  |PARTITIONED|

 project ([$$12])

 -- STREAM_PROJECT  |PARTITIONED|

   exchange

   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

     delete from TinySocial:TweetMessages from %0->$$4 partitioned by [%0->$$12]

     -- INSERT_DELETE  |PARTITIONED|

       exchange

       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

         materialize

         -- MATERIALIZE  |PARTITIONED|

           exchange

           -- HASH_PARTITION_EXCHANGE [$$12]  |PARTITIONED|

             assign [$$12] <- [function-call: asterix:field-access-by-index, Args:[%0->$$4, AInt32: {0}]]

             -- ASSIGN  |PARTITIONED|

               project ([$$4])

               -- STREAM_PROJECT  |PARTITIONED|

                 assign [$$4] <- [function-call: asterix:open-record-constructor, Args:[AString: {tweetid}, %0->$$14, AString: {user}, function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {1}], AString: {sender-location}, function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {2}], AString: {send-time}, function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {3}], AString: {referred-topics}, function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {4}], AString: {message-text}, function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {5}]]]

                 -- ASSIGN  |PARTITIONED|

                   exchange

                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

                     unnest-map [$$14, $$0] <- function-call: asterix:index-search, Args:[AString: {TweetMessages}, AInt32: {0}, AString: {TinySocial}, AString: {TweetMessages}, ABoolean: {false}, ABoolean: {false}, ABoolean: {false}, AInt32: {1}, %0->$$20, AInt32: {1}, %0->$$21, TRUE, TRUE, TRUE]

                     -- BTREE_SEARCH  |PARTITIONED|

                       exchange

                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

                         assign [$$20, $$21] <- [AString: {15}, AString: {15}]

                         -- ASSIGN  |PARTITIONED|

                           empty-tuple-source

                           -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

Change-Id: Ife8c378a62cdbbcd8c19b521de246162f1f3d6ec

Reviewed-on: https://asterix-gerrit.ics.uci.edu/267

Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

Reviewed-by: Wenhai Li <lwhaymail@yahoo.com>

Reviewed-by: Ildar Absalyamov <ildar.absalyamov@gmail.com>

Show less

master + 9 more