List:General Discussion« Previous MessageNext Message »
From:Kemin Zhou Date:September 13 2005 12:28am
Subject:serial primary key produces two indexes
View as plain text  
I recently discovered that the following

create table ttt (
    id serial primary key,
    txt text
);

show index from ttt

is telling me that there is a primary ke on id column with BTREE
and at the same time, there is another unique index on the id column.

This is redundant. 

if the id column had been specified as

id integer auto_increment primary key,
then there is only one primary key

So it looks that there is a bug in the mysql source code.
Could some exper please confirm my opinion?

I am using version 4.1

Kemin


Thread
serial primary key produces two indexesKemin Zhou13 Sep
  • Re: serial primary key produces two indexesGleb Paharenko13 Sep
    • Re: serial primary key produces two indexesKemin Zhou14 Sep