Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15771

Optimizer removes order by when it's sub-part of group by (test_if_subpart) too early

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.2.13
    • 10.2.12
    • Optimizer
    • None
    • MariaDB fork for Columnstore engine.

    Description

      Optimizer removes order by when it's sub-part of group by (test_if_subpart) too early, before it decides how to execute group by. Order by can only be removed if group by naturally delivers sorted results. it's not the case, for example, if group by is pushed down to the engine.
      Here is the example query that triggers the bug:
      select a,b,sum(c) from opportunities group by a,b order by a desc;

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              drrtuy Roman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.