Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: SQL Hint不好使
To improve efficiency, please provide the following information. Clear problem descriptions can be resolved faster:
[TiDB Usage Environment] Online, Testing, Research
[TiDB Version]
[Encountered Problem]
In an environment with only one TiFlash server node, I shut down this TiFlash and then executed count(). Because the only TiFlash service was shut down, an error was reported:
mysql> select count() from sbtest1;
ERROR 9012 (HY000): TiFlash server timeout
I want to use a hint to make this count go through the TiKV replica.
When connecting to the MySQL client, add the --comments option:
$ /home/tidb/tidb_init/mysql-5.7.26-el7-x86_64/bin/mysql -h xxx.xxx.xxx.xxx -uroot -P 4000 -p --comments
mysql> select /*+ read_from_storage(tikv[sbtest1]) / count() from sbtest1;
ERROR 9012 (HY000): TiFlash server timeout
It didn’t work; it still went through the TiFlash replica.
[Reproduction Path] What operations were performed to encounter the problem
[Problem Phenomenon and Impact]
[Attachments]
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.