Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2700

Fix invalid plan caused by order by operator in a subquery

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.4
    • 0.9.5
    • None

    Description

      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":

      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;
      

      Attachments

        Activity

          People

            alsuliman Ali Alsuliman
            alsuliman Ali Alsuliman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: