On Thu, 2009-05-28 at 08:04 +0200, John Fawcett wrote: > but maybe that's not such a good primary key, > probably better to do: > > mysql> CREATE TABLE expires ( > -> id integer not null auto_increment, > -> username varchar(100) not null, > -> mailbox varchar(255) not null, > -> expire_stamp integer not null, > -> primary key (id), > -> key (username, mailbox(200)) > -> ); > Query OK, 0 rows affected (0.00 sec)
Nothing uses the id, so I don't really see a point in having primary key at all then. You could instead create a unique index on (username, mailbox), unless MySQL disallows that too.
signature.asc
Description: This is a digitally signed message part
