文件首頁
MySQL 9.0 參考手冊
相關文件 下載本手冊
PDF (美國信紙) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 258.2Kb
Man Pages (Zip) - 365.3Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 參考手冊  /  ...  /  SHOW PARSE_TREE 陳述式

15.7.7.25 SHOW PARSE_TREE 陳述式

SHOW PARSE_TREE select_statement

SHOW PARSE_TREE 以 JSON 格式顯示輸入的 SELECT 陳述式的剖析樹狀結構表示。

注意

此陳述式僅在偵錯版本中可用,或者如果 MySQL 伺服器是使用 -DWITH_SHOW_PARSE_TREE 建置時才可用。它僅用於測試和開發,不適用於生產環境。

範例

mysql> SHOW PARSE_TREE SELECT * FROM t3 WHERE o_id > 2\G
*************************** 1. row ***************************
Show_parse_tree: {
  "text": "SELECT * FROM t3 WHERE o_id > 2",
  "type": "PT_select_stmt",
  "components": [
    {
      "text": "SELECT * FROM t3 WHERE o_id > 2",
      "type": "PT_query_expression",
      "components": [
        {
          "text": "SELECT * FROM t3 WHERE o_id > 2",
          "type": "PT_query_specification",
          "components": [
            {
              "text": "*",
              "type": "PT_select_item_list",
              "components": [
                {
                  "text": "*",
                  "type": "Item_asterisk"
                }
              ]
            },
            {
              "text": "t3",
              "type": "PT_table_factor_table_ident",
              "table_ident": "`t3`"
            },
            {
              "text": "o_id > 2",
              "type": "PTI_where",
              "components": [
                {
                  "text": "o_id > 2",
                  "type": "PTI_comp_op",
                  "operator": ">",
                  "components": [
                    {
                      "text": "o_id",
                      "type": "PTI_simple_ident_ident"
                    },
                    {
                      "text": "2",
                      "type": "Item_int"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
1 row in set (0.01 sec)