Return-Path: X-Original-To: apmail-asterixdb-notifications-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D813219F2D for ; Fri, 22 Apr 2016 02:42:16 +0000 (UTC) Received: (qmail 22357 invoked by uid 500); 22 Apr 2016 02:42:16 -0000 Delivered-To: apmail-asterixdb-notifications-archive@asterixdb.apache.org Received: (qmail 22321 invoked by uid 500); 22 Apr 2016 02:42:16 -0000 Mailing-List: contact notifications-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list notifications@asterixdb.incubator.apache.org Received: (qmail 22312 invoked by uid 99); 22 Apr 2016 02:42:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2016 02:42:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6A5DCC2684 for ; Fri, 22 Apr 2016 02:42:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.016 X-Spam-Level: X-Spam-Status: No, score=-5.016 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5fdFe-wKlQFa for ; Fri, 22 Apr 2016 02:42:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 29D475F476 for ; Fri, 22 Apr 2016 02:42:14 +0000 (UTC) Received: (qmail 22197 invoked by uid 99); 22 Apr 2016 02:42:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2016 02:42:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E53792C1F54 for ; Fri, 22 Apr 2016 02:42:12 +0000 (UTC) Date: Fri, 22 Apr 2016 02:42:12 +0000 (UTC) From: "Taewoo Kim (JIRA)" To: notifications@asterixdb.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ASTERIXDB-1411) Index-join is not picked for a LOJ query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ASTERIXDB-1411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15253224#comment-15253224 ] Taewoo Kim commented on ASTERIXDB-1411: --------------------------------------- Just checked the code on the master branch. It is correctly transformed into an INLJ. distribute result [%0->$$7] -- DISTRIBUTE_RESULT |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| project ([$$7]) -- STREAM_PROJECT |PARTITIONED| assign [$$7] <- [function-call: asterix:open-record-constructor, Args:[AString: {tweetid1}, %0->$$34, AString: {count1}, %0->$$28, AString: {t2info}, %0->$$22]] -- ASSIGN |PARTITIONED| exchange -- SORT_MERGE_EXCHANGE [$$34(ASC) ] |PARTITIONED| group by ([$$34 := %0->$$24]) decor ([%0->$$28]) { aggregate [$$22] <- [function-call: asterix:listify, Args:[function-call: asterix:open-record-constructor, Args:[AString: {tweetid2}, %0->$$25, AString: {count2}, %0->$$27]]] -- AGGREGATE |LOCAL| select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$25]]) -- STREAM_SELECT |LOCAL| nested tuple source -- NESTED_TUPLE_SOURCE |LOCAL| } -- PRE_CLUSTERED_GROUP_BY[$$24] |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| order (ASC, %0->$$24) (ASC, %0->$$25) -- STABLE_SORT [$$24(ASC), $$25(ASC)] |PARTITIONED| exchange -- HASH_PARTITION_EXCHANGE [$$24] |PARTITIONED| select (function-call: algebricks:and, Args:[function-call: algebricks:eq, Args:[%0->$$28, %0->$$27], function-call: algebricks:neq, Args:[%0->$$24, %0->$$25]]) -- STREAM_SELECT |PARTITIONED| project ([$$24, $$25, $$27, $$28]) -- STREAM_PROJECT |PARTITIONED| assign [$$27] <- [function-call: asterix:field-access-by-name, Args:[%0->$$1, AString: {countB}]] -- ASSIGN |PARTITIONED| project ([$$1, $$24, $$25, $$28]) -- STREAM_PROJECT |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| left-outer-unnest-map [$$25, $$1] <- function-call: asterix:index-search, Args:[AString: {TweetMessages}, AInt32: {0}, AString: {test}, AString: {TweetMessages}, ABoolean: {true}, ABoolean: {false}, AInt32: {1}, %0->$$39, AInt32: {1}, %0->$$39, TRUE, TRUE, TRUE] -- BTREE_SEARCH |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| order (ASC, %0->$$39) -- STABLE_SORT [$$39(ASC)] |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| project ([$$39, $$24, $$28]) -- STREAM_PROJECT |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| left-outer-unnest-map [$$38, $$39] <- function-call: asterix:index-search, Args:[AString: {msgCountBIx}, AInt32: {0}, AString: {test}, AString: {TweetMessages}, ABoolean: {true}, ABoolean: {true}, AInt32: {1}, %0->$$28, AInt32: {1}, %0->$$28, TRUE, TRUE, TRUE] -- BTREE_SEARCH |PARTITIONED| exchange -- BROADCAST_EXCHANGE |PARTITIONED| project ([$$24, $$28]) -- STREAM_PROJECT |PARTITIONED| assign [$$28] <- [function-call: asterix:field-access-by-index, Args:[%0->$$0, AInt32: {6}]] -- ASSIGN |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| unnest-map [$$24, $$0] <- function-call: asterix:index-search, Args:[AString: {TweetMessages}, AInt32: {0}, AString: {test}, AString: {TweetMessages}, ABoolean: {false}, ABoolean: {false}, AInt32: {0}, AInt32: {1}, %0->$$35, TRUE, FALSE, FALSE] -- BTREE_SEARCH |PARTITIONED| exchange -- ONE_TO_ONE_EXCHANGE |PARTITIONED| assign [$$35] <- [AInt64: {10}] -- ASSIGN |PARTITIONED| empty-tuple-source -- EMPTY_TUPLE_SOURCE |PARTITIONED| > Index-join is not picked for a LOJ query > ---------------------------------------- > > Key: ASTERIXDB-1411 > URL: https://issues.apache.org/jira/browse/ASTERIXDB-1411 > Project: Apache AsterixDB > Issue Type: Bug > Reporter: Yingyi Bu > Assignee: Taewoo Kim > > DDL: > {noformat} > drop dataverse test if exists; > create dataverse test; > use dataverse test; > create type TwitterUserType as closed { > screen-name: string, > lang: string, > friends-count: int64, > statuses-count: int64, > name: string, > followers-count: int64 > } > create type TweetMessageType as open { > tweetid: int64, > user: TwitterUserType, > sender-location: point, > send-time: datetime, > referred-topics: {{ string }}, > message-text: string, > countA: int64 > } > create dataset TweetMessages(TweetMessageType) > primary key tweetid; > create dataset TweetMessagesTmp(TweetMessageType) > primary key tweetid; > create index msgCountBIx on TweetMessages(countB: int64) type btree enforced; > {noformat} > Query: > {noformat} > use dataverse test; > for $t1 in dataset('TweetMessages') > where $t1.tweetid < int64("10") > order by $t1.tweetid > return { > "tweetid1": $t1.tweetid, > "count1":$t1.countA, > "t2info": for $t2 in dataset('TweetMessages') > where $t1.countA /* +indexnl */= $t2.countB and > $t1.tweetid != $t2.tweetid > order by $t2.tweetid > return {"tweetid2": $t2.tweetid, > "count2":$t2.countB} > }; > {noformat} > Query plan: > {noformat} > distribute result [%0->$$28] > -- DISTRIBUTE_RESULT |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > project ([$$28]) > -- STREAM_PROJECT |PARTITIONED| > assign [$$28] <- [function-call: asterix:open-record-constructor, Args:[AString: {tweetid1}, %0->$$41, AString: {count1}, %0->$$35, AString: {t2info}, %0->$$27]] > -- ASSIGN |PARTITIONED| > exchange > -- SORT_MERGE_EXCHANGE [$$41(ASC) ] |PARTITIONED| > group by ([$$41 := %0->$$31]) decor ([%0->$$35]) { > aggregate [$$27] <- [function-call: asterix:listify, Args:[function-call: asterix:open-record-constructor, Args:[AString: {tweetid2}, %0->$$32, AString: {count2}, %0->$$34]]] > -- AGGREGATE |LOCAL| > select (function-call: algebricks:not, Args:[function-call: algebricks:is-null, Args:[%0->$$40]]) > -- STREAM_SELECT |LOCAL| > nested tuple source > -- NESTED_TUPLE_SOURCE |LOCAL| > } > -- PRE_CLUSTERED_GROUP_BY[$$31] |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > order (ASC, %0->$$31) (ASC, %0->$$32) > -- STABLE_SORT [$$31(ASC), $$32(ASC)] |PARTITIONED| > exchange > -- HASH_PARTITION_EXCHANGE [$$31] |PARTITIONED| > left outer join (function-call: algebricks:and, Args:[function-call: algebricks:eq, Args:[%0->$$35, %0->$$34], function-call: algebricks:neq, Args:[%0->$$31, %0->$$32]]) > -- NESTED_LOOP |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > project ([$$35, $$31]) > -- STREAM_PROJECT |PARTITIONED| > assign [$$35] <- [function-call: asterix:field-access-by-index, Args:[%0->$$5, AInt32: {6}]] > -- ASSIGN |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > unnest-map [$$31, $$5] <- function-call: asterix:index-search, Args:[AString: {TweetMessages}, AInt32: {0}, AString: {test}, AString: {TweetMessages}, ABoolean: {false}, ABoolean: {false}, AInt32: {0}, AInt32: {1}, %0->$$42, TRUE, FALSE, FALSE] > -- BTREE_SEARCH |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > assign [$$42] <- [AInt64: {10}] > -- ASSIGN |PARTITIONED| > empty-tuple-source > -- EMPTY_TUPLE_SOURCE |PARTITIONED| > exchange > -- BROADCAST_EXCHANGE |PARTITIONED| > project ([$$32, $$34, $$40]) > -- STREAM_PROJECT |PARTITIONED| > assign [$$40, $$34] <- [TRUE, function-call: asterix:field-access-by-name, Args:[%0->$$6, AString: {countB}]] > -- ASSIGN |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > data-scan []<-[$$32, $$6] <- test:TweetMessages > -- DATASOURCE_SCAN |PARTITIONED| > exchange > -- ONE_TO_ONE_EXCHANGE |PARTITIONED| > empty-tuple-source > -- EMPTY_TUPLE_SOURCE |PARTITIONED| > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)