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

Optimizer_trace has invalid JSON near rows_estimation

    Details

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

      Description

      I thought that improvements to JSON writer would make this impossible, but
      somehow they didn't?

      create table ten(a int);
      insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
      set optimizer_trace=1;
      select * from ten where a<3 ;
      

      produces:

              "steps": [
                {
                   ...
                },
                ...
                {
                  "ref_optimizer_key_uses": []
                },
                "rows_estimation": [
                  {
                    "selectivity_for_indexes": [],
                    "selectivity_for_columns": []
                  },
                  {
                    "table": "ten",
                    "table_scan": {
                      "rows": 10,
                      "cost": 1
                    }
                  }
                ],
      

      Note that "rows_estimation" is a named element, but it is in the "steps" array.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                varun Varun Gupta
                Reporter:
                psergey Sergei Petrunia
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: