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

EXPLAIN FORMAT=JSON doesn't show order direction for filesort

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2
    • Fix Version/s: 10.2.12
    • Component/s: Optimizer
    • Labels:
      None
    • Sprint:
      10.2.12

      Description

      create table t1 (a int);
      insert into t1 values (1),(3),(2);
      

      Compare

      explain format=json select * from t1 order by a;
      EXPLAIN
      {
        "query_block": {
          "select_id": 1,
          "read_sorted_file": {
            "filesort": {
              "sort_key": "t1.a",
              "table": {
                "table_name": "t1",
                "access_type": "ALL",
                "rows": 3,
                "filtered": 100
              }
            }
          }
        }
      }
      

      with

      explain format=json select * from t1 order by a desc;
      EXPLAIN
      {
        "query_block": {
          "select_id": 1,
          "read_sorted_file": {
            "filesort": {
              "sort_key": "t1.a",
              "table": {
                "table_name": "t1",
                "access_type": "ALL",
                "rows": 3,
                "filtered": 100
              }
            }
          }
        }
      }
      

      It would be nice to print ASC or DESC somehow. Maybe, only print DESC, because ASC is default so for the sake of brevity it should be omitted.

        Attachments

          Activity

            People

            Assignee:
            varun Varun Gupta (Inactive)
            Reporter:
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: