# Multi-Table Join Solution

+ Execution plan


![left](./student-guide/diagram/01-51-1.png)

------------------------------------------------------------

After the mentioned index has been added, let's look at the execution plan:

(omitted)

From the execution plan, we see that the driving table t1 first performs an index range scan IndexRangeScan, which filters out about 34214.61 (estimated) records, and then returns the table IndexLookup to get the records of t1 that match the condition, and then uses the IndexHashJoin table join method and The t2 table performs a join operation. The data retrieval method for the t2 table is through the index on t2.k just added. The optimizer estimates that only 5.73 row are scanned per scan to retrieve the results, which is a significant performance improvement over the 1,000,000 row that need to be scanned when the index is not added.

With the above tuning, the execution time of this SQL has been reduced from 1.5 to 0.2 seconds, which is a noticeable improvement.
