---
title: explain route 因为 SQL 文本超长报错 “Route diagnosis not supports this query” 的原因和解决方法-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于explain route 因为 SQL 文本超长报错 “Route diagnosis not supports this query” 的原因和解决方法相关的常见问题和使用技巧，帮助您快速解决explain route 因为 SQL 文本超长报错 “Route diagnosis not supports this query” 的原因和解决方法的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
[OceanBase AI 数据大会](https://www.oceanbase.com/conference2026 "OceanBase AI 数据大会")

## 体验新一代 AI 数据平台

[立即咨询](https://www.oceanbase.com/contactus) [免费试用 免费试用](https://www.oceanbase.com/free-trial)划线反馈

# explain route 因为 SQL 文本超长报错 “Route diagnosis not supports this query” 的原因和解决方法

更新时间：2026-07-17 07:16

适用版本： V4.x 内容类型：Troubleshoot  

## 问题现象

OBProxy V4.x 版本中提供了 `explain route <your_sql>;` 命令用来获取 SQL 语句的路由状态信息，并展示详细的诊断信息。`<your_sql>` 语句将会在 OBProxy 内部进行处理，执行正常的 OBProxy 转发流程，但不会真正转发给 OBServer 节点。

示例如下：

对于按照 `hash(id)` 进行分区的分区表 `t1`。

```shell
$ mysql -hxx.xxx.80.111 -P2883 -uroot@mysqlt#oio_cluster -pxxx -A -c test
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1619840
Server version: 5.6.25 OceanBase 4.2.5.3 (r103000142025033110-f5b88cd987f23383677f2eb53cf76ed38a48979b) (Built Mar 31 2025 11:04:29)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [test]> explain route select * from t1 where id=1;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Route Plan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
Trans Current Query:"explain route select * from t1 where id=1"

Route Prompts
-----------------
> ROUTE_INFO
  [INFO] Will do table partition location lookup to decide which OBServer to route to
> ROUTE_POLICY
  [INFO] Will route to table's partition leader replica(xx.xxx.80.111:2881) using route policy PRIMARY_ZONE_FIRST because query for STRONG read

Route Plan
-----------------
> SQL_PARSE:{cmd:"COM_QUERY", table:"t1"}
> ROUTE_INFO:{route_info_type:"USE_PARTITION_LOCATION_LOOKUP"}
> LOCATION_CACHE_LOOKUP:{mode:"oceanbase"}
  > TABLE_ENTRY_LOOKUP_DONE:{table:"t1", table_id:"500033", table_type:"USER TABLE", partition_num:30, entry_from_remote:false}
  > PARTITION_ID_CALC_START:{}
    > EXPR_PARSE:{col_val:"id=1"}
    > RESOLVE_EXPR:{part_range:"[1 ; 1]"}
      > RESOLVE_TOKEN:{token_type:"TOKEN_INT_VAL", resolve:"BIGINT:1", token:"1"}
    > CALC_PARTITION_ID:{part_description:"partition by hash(INT<binary>) partitions 30"}
  > PARTITION_ID_CALC_DONE:{partition_id:200032, level:1, partitions:"(p1)"}
  > PARTITION_ENTRY_LOOKUP_DONE:{leader:"xx.xxx.80.111:2881"}
> ROUTE_POLICY:{route_policy:"", chosen_route_type:"ROUTE_TYPE_LEADER"}
> CONGESTION_CONTROL:{svr_addr:"xx.xxx.80.111:2881"}
 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

```

但是，如果需要 explain route 的 SQL 文本过长，该命令会遇到如下的报错。

MySQL [test]> source /tmp/explain_route_long_sql_text.sql;
+-----------------------------------------+
| Route Plan                              |
+-----------------------------------------+
| Route diagnosis not supports this query |
+-----------------------------------------+
1 row in set (0.000 sec)

```

## 问题原因

目前 OBProxy 在尝试获取 SQL 语句的路由信息时，如果在 `request_buffer_length` 长度内还没有解析到完整的表名，OBProxy 将无法获取路由信息。因此，如果 explain route 时遇到报错 “Route diagnosis not supports this query”，可以看看是不是这条 SQL 文本超长了，超过了 `request_buffer_length` 的限制，如果超过了可以考虑调大 OBProxy 配置项 `request_buffer_length` 的大小。

```shell
MySQL [(none)]> show proxyconfig like 'request_buffer_length'; // 用于设置每个请求分配的请求 buffer 的最大长度，取值范围：[1KB, 16MB]。默认值：4K（OBProxy V4.3.4 中将默认值由 4K 调大到 8K）
+-----------------------+-------+-----------------------------------------------------------------+-------------+---------------+
| name                  | value | info                                                            | need_reboot | visible_level |
+-----------------------+-------+-----------------------------------------------------------------+-------------+---------------+
| request_buffer_length | 4KB   | the max length of request buffer we will alloc for each reqeust | false       | USER          |
+-----------------------+-------+-----------------------------------------------------------------+-------------+---------------+
1 row in set (0.00 sec)

```

说明：`request_buffer_length` 默认值为 4K，对超过 4KB 的还没有解析到表名的请求，OBProxy 无法获取路由信息会随机路由，可能会导致远程路由，对性能影响较大。业务中多次遇到此问题，因此 OBProxy V4.3.4 版本中将 `request_buffer_length` 配置项的默认值由 4KB 调大到 8KB。

## 问题的风险及影响

通过 explain route 命令来获取 SQL 语句的路由信息失败。

## 适用版本

OBProxy V4.x 版本。

## 解决方法

连接到 root@sys# 集群名，调大 OBProxy 配置项 `request_buffer_length` 的大小，比如将该配置项调大到超过需要 explain route 的 SQL 文本的长度。

```shell
$ mysql -hxx.xxx.80.111 -P2883 -uroot@sys#oio_cluster -pxxx -A -c oceanbase
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1619874
Server version: 5.6.25 OceanBase 4.2.5.3 (r103000142025033110-f5b88cd987f23383677f2eb53cf76ed38a48979b) (Built Mar 31 2025 11:04:29)

MySQL [oceanbase]> alter proxyconfig set request_buffer_length='64KB';
Query OK, 0 rows affected (0.03 sec)

MySQL [oceanbase]> Bye

```

然后再执行之前报错的 explain route 语句，应该就可以正常工作了。 **注意：`request_buffer_length` 是 client 和 OBProxy 建连每个 SESSION 需要申请的内存一部分，所以如果只调大这个参数，而不将 OBProxy 内存也调大（默认值：2G），很容易将 OBProxy 内存打爆。建议同时调大 OBProxy 的内存上限 `proxy_mem_limited`，或者在解析完该超长 SQL 文本后，将 `request_buffer_length` 再恢复回去：**

```shell
MySQL [oceanbase]> alter proxyconfig set request_buffer_length='4KB';
Query OK, 0 rows affected (0.00 sec)

```

## 规避方式

无。

Previous

[分布式查询全部路由到一个节点导致负载不均的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000003265247)

Next

[读写分离路由策略未生效](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000005401696) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ) 咨询
