EXPLAIN与hint不匹配的问题

【产品名称】oceanbase

【产品版本】3.1.2

【问题描述】为什么explain出来的查询计划跟我hint的要求不一样?

示例:

explain select /*+LEADING(table_0 table_3 table_5 table_6)*/ count(*) from table_0, table_6, table_5, table_3 where table_0.fk_0 = table_6.primaryKey and table_0.fk_1 = table_5.primaryKey and table_0.fk_3 = table_3.primaryKey and table_0.col_0 > 10000 and table_5.col_6 > 10000 and table_6.col_3 > 10000 and table_3.col_2 > 10000;

explain select /*+USE_MERGE(table_0 table_3 table_5 table_6)*/ count(*) from table_0, table_6, table_5, table_3 where table_0.fk_0 = table_6.primaryKey and table_0.fk_1 = table_5.primaryKey and table_0.fk_3 = table_3.primaryKey and table_0.col_0 > 10000 and table_5.col_6 > 10000 and table_6.col_3 > 10000 and table_3.col_2 > 10000;

得到的查询计划和我想要的不一样,请问这是什么原因呢?我的hint语法有问题吗?

用 mysql 或者 obclient 连接的时候,带上 参数 -c ,这个做了吗

可以了,谢谢!请问这个参数是什么意思?

可以参考下这个文档:https://open.oceanbase.com/docs/observer-cn/V3.1.1/10000000000013770