MariaDB [test]> create table customer ( c_indx integer not null primary key, c_name varchar(30));
|
Query OK, 0 rows affected (0.002 sec)
|
|
MariaDB [test]> insert into customer select seq, concat("bob", seq ) from seq_1_to_90000;
|
Query OK, 90000 rows affected (0.172 sec)
|
Records: 90000 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> explain update customer set c_name = "ttt" where c_indx =2387657687258;
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| 1 | SIMPLE | customer | range | PRIMARY | PRIMARY | 4 | NULL | 1 | Using where |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain update customer set c_name = "ttt" where c_indx ='2387657687258';
|
+------+-------------+----------+-------+---------------+---------+---------+------+-------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+----------+-------+---------------+---------+---------+------+-------+-------------+
|
| 1 | SIMPLE | customer | index | NULL | PRIMARY | 4 | NULL | 90497 | Using where |
|
+------+-------------+----------+-------+---------------+---------+---------+------+-------+-------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain select * from customer where c_indx ='2387657687258';
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE noticed after reading const tables |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain select * from customer where c_indx = 2387657687258;
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE noticed after reading const tables |
|
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain select * from customer where c_indx ='23258';
|
+------+-------------+----------+-------+---------------+---------+---------+-------+------+-------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+----------+-------+---------------+---------+---------+-------+------+-------+
|
| 1 | SIMPLE | customer | const | PRIMARY | PRIMARY | 4 | const | 1 | |
|
+------+-------------+----------+-------+---------------+---------+---------+-------+------+-------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain update customer set c_name = "ttt" where c_indx ='23258';
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| 1 | SIMPLE | customer | range | PRIMARY | PRIMARY | 4 | NULL | 1 | Using where |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> explain update customer set c_name = "ttt" where c_indx = 23258;
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
| 1 | SIMPLE | customer | range | PRIMARY | PRIMARY | 4 | NULL | 1 | Using where |
|
+------+-------------+----------+-------+---------------+---------+---------+------+------+-------------+
|
1 row in set (0.001 sec)
|