PolarDB这种sql为啥也不走列存呢 ?我改了下发现还不走。SELECT DISTINCT sk.search_type, sk.search_keywords FROM t_e_search_keywords sk WHERE sk.search_type = ‘1’ AND sk.ip = ‘ 139.5.31.25’ AND LENGTH(sk.search_keywords) = CHAR_LENGTH(sk.search_keywords) ORDER BY sk.search_time DESC LIMIT 10;SELECT DISTINCT sk.search_type, sk.search_keywords,sk.search_time FROM t_e_search_keywords sk WHERE sk.search_type = ‘1’ AND sk.ip = ‘ 139.5.31.25’ AND LENGTH(sk.search_keywords) = CHAR_LENGTH(sk.search_keywords) ORDER BY sk.search_time DESC LIMIT 10; 加上order by的这个字段也不走
以下为热心网友提供的参考意见
第一条是不会走的,得升级; 第二条应该是可以的,针对order by limit 这些sql在一些情况下代价估算不太准确, 导致cost比较小就路由到行存了, 刚才配置一些选项, 断开连接试试,不行再show variables like ‘%imci%opt%’; 试试。此回答整理自钉群“PolarDB专家面对面 – HTAP(列存索引)”