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

Odd EXPLAIN FORMAT=JSON output for SELECT DISTINCT ... GROUP BY query

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • 10.4, 10.5, 10.6
    • Optimizer
    • None

    Description

      create table t2 (a int, b int);
      insert into t2 select seq/100, seq from seq_1_to_1000;
      explain format=json select distinct 1+max(b) from t2 group by a;
      

      gives

        "query_block": {
          "select_id": 1,
          "filesort": {
            "sort_key": "t2.a",
            "duplicate_removal": {
              "temporary_table": {
                "temporary_table": {
                  "nested_loop": [
                    {
                      "table": {
                        "table_name": "t2",
                        "access_type": "ALL",
                        "rows": 1000,
                        "filtered": 100
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
      

      note the

              "temporary_table": {
                "temporary_table": {
      

      part.

      This doesn't allow one to understand the purpose of the temporary tables.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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