# Optimizer Hints
+ Based on the comment-like syntax introduced in `MySQL 5.7` and case-insensitive
+ Incorrect or incomplete hints will not cause statement errors
+ Correct hints cannot take effect in all situations
+ Optimizer hints are specified within `/*+ ... */` comments following the **`SELECT`**, **`UPDATE`**, or **`DELETE`** keywords
```
SELECT ~!@/*+ HASH_JOIN(employees, salaries) */@!~ ...
SELECT ~!@/*+ USE_INDEX(t1, idx1) */@!~ ...
```
------------------------------------------------------------------------------
In TiDB, optimizer hints are based on the comment-like syntax introduced in MySQL 5.7. For example, a common syntax is `/*+ HINT_NAME([t1_name [, t2_name] ...]) */`. Utilizing optimizer hints is advisable when the TiDB optimizer chooses a less efficient query plan.

There are certain situations where optimizer hints may not be effective, such as:

1. `Hints` do not take effect if your MySQL command-line client strips them.
2. `Hints` do not take effect if the database name is not specified.
3. `Hints` do not take effect if the database name is not explicitly specified in cross-table queries.
4. `Hints` do not take effect if they are placed in incorrect locations.
5. The `INL_JOIN Hint` might not take effect due to collation incompatibility.
6. The `INL_JOIN Hint` might not take effect because of the join order.

For more details, visit: https://docs.pingcap.com/tidb/stable/optimizer-hints#troubleshoot-common-issues-that-hints-do-not-take-effect