You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Xikui Wang (JIRA)" <ji...@apache.org> on 2018/07/14 00:25:00 UTC

[jira] [Assigned] (ASTERIXDB-2412) Extract common expr should not be applied to JOIN

     [ https://issues.apache.org/jira/browse/ASTERIXDB-2412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xikui Wang reassigned ASTERIXDB-2412:
-------------------------------------

    Assignee: Xikui Wang

> Extract common expr should not be applied to JOIN
> -------------------------------------------------
>
>                 Key: ASTERIXDB-2412
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2412
>             Project: Apache AsterixDB
>          Issue Type: Bug
>            Reporter: Xikui Wang
>            Assignee: Xikui Wang
>            Priority: Major
>
> {code}
> drop dataverse Coffee if exists;
> create dataverse Coffee;
> use Coffee;
> create type CoffeeType as {
>     id: string,
>     location: point
> };
> create type FollowersType as {
>     user_id: string,
>     twitter_id: string,
>     followers: [string]
> };
> create dataset Coffee(CoffeeType)
>     primary key id;
> create dataset Followers(FollowersType)
>     primary key user_id;
> create type CoffeeUser as closed {
>     id: int64,
>     id_str: string
> };
> create type Tweet as open {
>     id: int64,
>     user: CoffeeUser,
>     timestamp_ms: string
> };
> create dataset Tweets (Tweet)
> primary key id;
> select * from Tweets t
> let followers = (select * from Tweets f where spatial_intersect(create_circle(create_point(f.place.bounding_box.coordinates[0][0][0],f.place.bounding_box.coordinates[0][0][1]),5.0),
> create_circle(create_point(t.place.bounding_box.coordinates[0][0][0],t.place.bounding_box.coordinates[0][0][1]),5.0))),
> sb = (select value s.location from Coffee s where spatial_intersect(create_circle(create_point(t.place.bounding_box.coordinates[0][0][0],t.place.bounding_box.coordinates[0][0][1]),5.0),s.location));
> {code}
> The above query wouldn't work as the ExtractCommonExpressionsRule extracts the common exprs in the two LeftOutterJoin operators and pulls the join condition in the second op. Let alone this is wrong for the LOJ case, the cost for adding cartesian product is much higher than evaluating the same expr. twice. This should be fixed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)