Does `SERIAL PRIMARY KEY` create two indexes on the table? Since SERIAL is shorthand for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE, it looks like SERIAL PRIMARY KEY doubles up on the UNIQUE and PRIMARY KEY:

&gt; CREATE TEMPORARY TABLE foo (id SERIAL PRIMARY KEY);

&gt; SHOW CREATE TABLE foo \G
*************************** 1. row ***************************
       Table: foo
Create Table: CREATE TABLE `foo` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
)


There's definitely the wtf factor of seeing both PRIMARY KEY and UNIQUE KEY id in SHOW CREATE TABLE, but is that really two physical indexes I'm seeing?

Should one avoid using PRIMARY KEY with SERIAL and instead opt for writing bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, or using SERIAL with no primary keys on the table?
I'm also seeing this behavior in 5.7.18 MySQL Community Server. 

Based on the output from SHOW INDEX FROM foo there is a duplicate index being created and maintained:

mysql&gt; CREATE TEMPORARY TABLE foo (id SERIAL PRIMARY KEY);
Query OK, 0 rows affected (0.00 sec)

mysql&gt; show index from foo;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| foo   |          0 | PRIMARY  |            1 | id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| foo   |          0 | id       |            1 | id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)


Edit: This also happens for normal tables:

mysql&gt; CREATE TABLE foo (id SERIAL PRIMARY KEY);
Query OK, 0 rows affected (0.01 sec)

mysql&gt; show index from foo;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| foo   |          0 | PRIMARY  |            1 | id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| foo   |          0 | id       |            1 | id          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)

mysql&gt; select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = 'foo';
+--------------------+-------------------+-----------------+--------------+------------+-----------------+
| CONSTRAINT_CATALOG | CONSTRAINT_SCHEMA | CONSTRAINT_NAME | TABLE_SCHEMA | TABLE_NAME | CONSTRAINT_TYPE |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+
| def                | my_db             | PRIMARY         | my_db        | foo        | PRIMARY KEY     |
| def                | my_db             | id              | my_db        | foo        | UNIQUE          |
+--------------------+-------------------+-----------------+--------------+------------+-----------------+
2 rows in set (0.00 sec)