# `VERSION::6.1.0` Working with Joins - Case Study - Cont'd

+ The `LEADING(t1_name [, tl_name ...])` hint requires the optimizer to join multi-table according to the order of specified in the hint

![`smart`](OptimizerHints07_en_001_20240207.png)

----------------------------------------------------
We executed the SQL query with an `Optimizer Hint` added as follows:

```
SELECT /*+ LEADING(TA, TD, TC, TB) */ COUNT(*) FROM TA, TB, TC, TD WHERE TA.col1 = TB.col1 AND TA.col2 = TC.col2 AND TA.col2 = TD.col2;
```

The hint `/*+ LEADING(TA, TD, TC, TB) */` instructs the optimizer to join the tables in the order `TA` - `TD` - `TC` - `TB`. After the initial joins of `TA`, `TD`, and `TC`, the `actRows` count for the result set is 150. However, once `TB` is added to the join, the `actRows` count increases to 1,800, resulting in a `HashJoin` operator ratio with its child operator of 1,200%. We also observed that the `estRows` count, which is 297,029.70 after joining `TA`, `TD`, and `TC`, rises to 3,564,356.44 after adding `TB`, maintaining the same `HashJoin` ratio of 1,200%. Therefore, the current join order is the optimal choice.