# Logical Transformation - Eliminate Outer Join Example - Cont'd
```6
SELECT t1.id as t1_id, t1.val as t1_val, t2.id as t2_id, t2.val as t2_val
FROM ~!@t1 LEFT JOIN t2@!~ ON t1.id = t2.id
WHERE ~!@t2.val > 11@!~;

+-------+--------+-------+--------+
| t1_id | t1_val | t2_id | t2_val |
+-------+--------+-------+--------+
|     1 |     11 |     1 |     21 |
|     2 |     12 |     2 |     22 |
|     3 |     13 |     3 |     23 |
+-------+--------+-------+--------+
```

+ The **`WHERE`** condition **`t2.val > 11`** filters out rows with a **`NULL`** value for **`t2_val`**
+ **`LEFT OUTER JOIN`** transforms into **`INNER JOIN`**

```6
~!@EXPLAIN@!~ SELECT t1.id as t1_id, t1.val as t1_val, t2.id as t2_id, t2.val as t2_val
FROM ~!@t1 LEFT JOIN t2@!~ ON t1.id = t2.id
WHERE ~!@t2.val > 11@!~;

+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
| id                             | estRows | task      | access object | operator info                                    |
+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
...                                                                                                                     ...
| └─HashJoin_20                  | 3.57    | root      |               | ~!@inner join@!~, equal:[eq(test.t2.id, test.t1.id)]   |
...                                                                                                                     ...
+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
```
------------------------------------------------------------------------------
Next, in the `WHERE` clause, we observe the condition `t2.val > 11`, which filters out any result sets containing `NULL` values in the `val` column. As a result, the outer join (`LEFT JOIN`) can be converted to an inner join (`INNER JOIN`) to potentially enhance performance.

```
SELECT t1.id as t1_id, t1.val as t1_val, t2.id as t2_id, t2.val as t2_val
FROM t1 LEFT JOIN t2 ON t1.id = t2.id
WHERE t2.val > 11;

+-------+--------+-------+--------+
| t1_id | t1_val | t2_id | t2_val |
+-------+--------+-------+--------+
|     1 |     11 |     1 |     21 |
|     2 |     12 |     2 |     22 |
|     3 |     13 |     3 |     23 |
+-------+--------+-------+--------+
3 rows in set (0.00 sec)
```

Note the second line (`HashJoin` operation) in the table below; the `operator info` column header indicates that it is executing an `inner join`. Thus, the outer join has been rewritten as an inner join.

```
EXPLAIN SELECT t1.id as t1_id, t1.val as t1_val, t2.id as t2_id, t2.val as t2_val
FROM t1 LEFT JOIN t2 ON t1.id = t2.id
WHERE t2.val > 11;

+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
| id                             | estRows | task      | access object | operator info                                    |
+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
| Projection_9                   | 3.57    | root      |               | test.t1.id, test.t1.val, test.t2.id, test.t2.val |
| └─HashJoin_20                  | 3.57    | root      |               | inner join, equal:[eq(test.t2.id, test.t1.id)]   |
|   ├─TableReader_23(Build)      | 3.57    | root      |               | data:Selection_22                                |
|   │ └─Selection_22             | 3.57    | cop[tikv] |               | gt(test.t2.val, 11), not(isnull(test.t2.id))     |
|   │   └─TableFullScan_21       | 7.00    | cop[tikv] | table:t2      | keep order:false                                 |
|   └─TableReader_25(Probe)      | 6.00    | root      |               | data:TableFullScan_24                            |
|     └─TableFullScan_24         | 6.00    | cop[tikv] | table:t1      | keep order:false                                 |
+--------------------------------+---------+-----------+---------------+--------------------------------------------------+
7 rows in set (0.01 sec)
```

We will explore the execution plan in greater detail in the following chapter.