[MDEV-29957] Optimizer trace: print join prefix as scalar, not array Created: 2022-11-06  Updated: 2023-02-01  Resolved: 2023-02-01

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 11.0.1

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: optimizer_trace


 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".



 Comments   
Comment by Sergei Petrunia [ 2023-02-01 ]

Fixed in bb-11.0 tree

Generated at Thu Feb 08 10:12:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.