# Implicit Data Type Conversion Case Study Background

+ Table definition:

```13
CREATE TABLE t3 (
 id int(11) NOT NULL AUTO_INCREMENT,
 ~!@k varchar(10)@!~ NOT NULL DEFAULT '0',
 c char(120) NOT NULL DEFAULT '',
 pad char(60) NOT NULL DEFAULT '',
 PRIMARY KEY (id) ,
 ~!@KEY k_2 (k)@!~
) 
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 
AUTO_INCREMENT=1629882;
```

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

When we perform operations on different data type in a database (for example, where clause filters a=1 or join a.id=b.id), the database implicitly converts the relevant type for operational compatibility. Let's introduce the problems caused by implicit type conversion through examples.

Specific case

We have a table like this:

```
CREATE TABLE t3 (
 id int(11) NOT NULL AUTO_INCREMENT,
 k varchar(10) NOT NULL DEFAULT '0',
 c char(120) NOT NULL DEFAULT '',
 pad char(60) NOT NULL DEFAULT '',
 PRIMARY KEY (id) ,
 KEY k_2 (k)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1629882;
```

Where column k is of type varchar, and k has a normal index of k_2, let's take a look at the following “normal” SQL and execution plan:
