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

Optimizer trace: print join prefix as scalar, not array

    XMLWordPrintable

Details

    Description

      Troubleshooting join optimization involves examining what happened whenwe were considering certain join prefix, e.g. t1,t2,t3,...

      Optimizer trace prints the join prefix as plan_prefix array:

            "rest_of_plan": [
              {
                "plan_prefix": ["t1", "t2", "t3"],
                "get_costs_for_tables": [
      

      Problems with this representation are:

      • it's hard to type all the quotes and spaces when grepping.
      • if line length exceeds 80 chars the array is printed as

                "plan_prefix": [
                  "t1", 
                  "t2", 
                  "t3"],
      

      which makes grepp-ing nearly impossible.

      A counter-argument is, why doesn't one use JSONPath language to search for an "array of t1, t2, t3?"

      Reply to that: MariaDB's JSONPath dialect doesn't support predicates at all. Even if we did support full JSONPath, searching for array of

      {t1 t2 t3}

      would look like this

       $.plan_prefix? (@[1]=="t1" && @[2]="t2" && @[3]="t3")
      

      which is still way behind grepping for "plan_prefix": "t1,t2,t3".

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.