You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/03/09 00:16:00 UTC

[jira] [Commented] (ASTERIXDB-2700) Fix invalid plan caused by order by operator in a subquery

    [ https://issues.apache.org/jira/browse/ASTERIXDB-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054572#comment-17054572 ] 

ASF subversion and git services commented on ASTERIXDB-2700:
------------------------------------------------------------

Commit bdc5c05a79a3da6a1dc95cf8877470c224bfe79f in asterixdb's branch refs/heads/master from Ali Alsuliman
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=bdc5c05 ]

[ASTERIXDB-2700][*DB][RT] Fix invalid plan caused by order-by operator in a subquery

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
Instead of removing a redundant sort operator from the plan, replace it with
an empty assign operator to avoid potential connection of a sort-merge connector
to another connector.

- modified RemoveUnusedAssignAndAggregateRule to excluded necessary empty
  assign operators from being removed.

Change-Id: I8bc11fa046cb15fab04057086817bd400b7809c0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/5103
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <al...@gmail.com>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>


> Fix invalid plan caused by order by operator in a subquery
> ----------------------------------------------------------
>
>                 Key: ASTERIXDB-2700
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2700
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: *DB - AsterixDB, RT - Runtime
>    Affects Versions: 0.9.4
>            Reporter: Ali Alsuliman
>            Assignee: Ali Alsuliman
>            Priority: Major
>             Fix For: 0.9.5
>
>
> The below query produces an invalid plan where two connectors are connected to each other. This happens when the optimizer optimizes the order-by operator by replacing it with a local order-by operator + sort-merge connector. If the parent operator of the original order-by operator introduces a connector, the plan ends up having two connectors. Here is an example query where there is an index on "user_since" and index on "author_id":
> {code:java}
> SET `compiler.sort.parallel` "false";
>  
> FROM (SELECT VALUE u FROM GleambookUsersCompositeRandom u WHERE u.user_since >= '2008-07-22T00:00:00' ORDER BY u.id) AS user, GleambookMessagesCompositeRandom AS msg
> WHERE msg.author_id /*+ indexnl */ = user.id
> SELECT user.name AS uname, msg.message AS message;
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)