Manual Hints in TiDB

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: Tidb 手工hint

| username: 气死人的萌新

[Test Environment for TiDB]
[TiDB Version] v6.1.0
[Reproduction Path]
[Encountered Issue: The hint verification result is different from the official documentation, as shown in the figure]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]


Experimenting with this statement, the result is as follows

It used HashJoin instead of IndexJoin. I checked and found that before version V6.4.0, it also used IndexJoin.

Very confused, can any expert explain this to a newbie?

| username: ShawnYan | Original post link

Could you please send the document link?

| username: 气死人的萌新 | Original post link

Use EXPLAIN to View the Execution Plan of JOIN Queries | PingCAP Documentation Center

| username: Jasper | Original post link

Try adding --comments when connecting with the MySQL client?

| username: 气死人的萌新 | Original post link

I did an experiment, and it worked. Why is that?

| username: tidb菜鸟一只 | Original post link

No problem

| username: Jasper | Original post link

Because if not added, comments will be excluded by default, meaning the content in the hint will be automatically ignored.

| username: ShawnYan | Original post link

The old version of the MySQL client will ignore hints by default, you need to manually add -c.

| username: 气死人的萌新 | Original post link

I manually operated it once and found the result was incorrect. I copied and pasted it again, and both results were the same. I don’t know why :sob:

| username: 气死人的萌新 | Original post link

Thank you, thank you.

| username: zhanggame1 | Original post link

Using the command line is overwhelming, better install a tool.

| username: 气死人的萌新 | Original post link

I’m using Xshell. Do you have any recommended tools?

| username: zhanggame1 | Original post link

You can take a look here.

| username: cy6301567 | Original post link

Is this thing easy to use?

| username: redgame | Original post link

Sure, please provide the Chinese text you need translated.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.