Skip to content

Commit

Permalink
*: improve INL_HASH_JOIN document about collation incompatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed May 14, 2024
1 parent a405139 commit 2de6fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimizer-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,9 @@ The warning is as follows:

In this case, you need to place the hint directly after the `SELECT` keyword. For more details, see the [Syntax](#syntax) section.

### INL_JOIN hint does not take effect due to collation incompatibility
### INL_JOIN, INL_HASH_JOIN hint does not take effect due to collation incompatibility

When the collation of the join key is incompatible between two tables, the `IndexJoin` operator cannot be utilized to execute the query. In this case, the [`INL_JOIN` hint](#inl_joint1_name--tl_name-) does not take effect. For example:
When the collation of the join key is incompatible between two tables, the `IndexJoin` operator cannot be utilized to execute the query. In this case, the [`INL_JOIN` hint](#inl_joint1_name--tl_name-) or [`INL_HASH_JOIN` hint](#inl_hash_join) does not take effect. For example:

```sql
CREATE TABLE t1 (k varchar(8), key(k)) COLLATE=utf8mb4_general_ci;
Expand All @@ -955,7 +955,7 @@ The execution plan is as follows:
5 rows in set, 1 warning (0.00 sec)
```

In the preceding statements, the collations of `t1.k` and `t2.k` are incompatible (`utf8mb4_general_ci` and `utf8mb4_bin` respectively), which prevents the `INL_JOIN` or `TIDB_INLJ` hint from taking effect.
In the preceding statements, the collations of `t1.k` and `t2.k` are incompatible (`utf8mb4_general_ci` and `utf8mb4_bin` respectively), which prevents the `INL_JOIN`, `TIDB_INLJ` or `INL_HASH_JOIN` hint from taking effect.

```sql
SHOW WARNINGS;
Expand Down

0 comments on commit 2de6fad

Please sign in to comment.