# Optimizer Hints - Example - Cont'd

+ The `INL_JOIN(t1_name [, tl_name ...])` hint tells the optimizer to use the index nested loop join algorithm for the given table(s).

```
tidb> EXPLAIN SELECT * FROM employees, salaries WHERE employees.emp_no = salaries.emp_no;
+-------------------------+------------+-----------+-----------------+--------------------------------------------------------------------------+
| id                      | estRows    | task      | access object   | operator info                                                            |
+-------------------------+------------+-----------+-----------------+--------------------------------------------------------------------------+
| MergeJoin_8             | 2825288.58 | root      |                 | inner join, left key:db1.employees.emp_no, right key:db1.salaries.emp_no |
| ├─TableReader_32(Build) | 2844047.00 | root      |                 | data:TableFullScan_31                                                    |
| │ └─TableFullScan_31    | 2844047.00 | cop[tikv] | table:salaries  | keep order:true                                                          |
| └─TableReader_30(Probe) | 300024.00  | root      |                 | data:TableFullScan_29                                                    |
|  └─TableFullScan_29     | 300024.00  | cop[tikv] | table:employees | keep order:true                                                          |
+-------------------------+------------+-----------+-----------------+--------------------------------------------------------------------------+
5 rows in set (0.00 sec)

tidb> EXPLAIN SELECT /*+ INL_JOIN(employees, salaries) */ * FROM employees, salaries WHERE employees.emp_no = salaries.emp_no;
+-------------------------+------------+-----------+-----------------+-------------------------------------------------------------------------------------------------...+
| id                      | estRows    | task      | access object   | operator info                                                                                   ...|
+-------------------------+------------+-----------+-----------------+-------------------------------------------------------------------------------------------------...+
| IndexJoin_12            | 2825288.58 | root      |                 | inner join, inner:TableReader_9, outer key:db1.employees.emp_no, inner key:db1.salaries.emp_no, ...|
| ├─TableReader_27(Build) | 300024.00  | root      |                 | data:TableFullScan_26                                                                           ...|
| │ └─TableFullScan_26    | 300024.00  | cop[tikv] | table:employees | keep order:false                                                                                ...|
| └─TableReader_9(Probe)  | 300024.00  | root      |                 | data:TableRangeScan_8                                                                           ...|
|  └─TableRangeScan_8     | 300024.00  | cop[tikv] | table:salaries  | range: decided by [eq(db1.salaries.emp_no, db1.employees.emp_no)], keep order:false             ...|
+-------------------------+------------+-----------+-----------------+-------------------------------------------------------------------------------------------------...+
5 rows in set (0.00 sec)
```
----------------------------------------------------
In the first SQL statement, we relied on the execution plan generated by the optimizer, which used the `MergeJoin` method. If a different join method is required, it can be specified using a hint.

In the second SQL statement, we applied the hint `/*+ INL_JOIN(employees, salaries) */` to change the join method between the employees and salaries tables to `IndexJoin`.