Jonas
03.07.2002, 17:38
Ich habe folgende Tabelle:
CREATE TABLE rights (
id mediumint(8) unsigned NOT NULL auto_increment,
mod char(5) NOT NULL default '',
groupid tinyint(2) unsigned NOT NULL default '0',
siteid tinyint(2) unsigned NOT NULL default '1',
rightid tinyint(2) unsigned NOT NULL default '0',
rightvalue tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY unique_key (mod,groupid,siteid,rightid),
KEY select_key (mod,groupid,siteid)
);
Da ist doch der Index select_key eigentlich unnötig, oder? Denn ein UNIQUE KEY ist doch auch ein Index, halt mit dem Zusatz daß noch alles unique ist, oder?
CREATE TABLE rights (
id mediumint(8) unsigned NOT NULL auto_increment,
mod char(5) NOT NULL default '',
groupid tinyint(2) unsigned NOT NULL default '0',
siteid tinyint(2) unsigned NOT NULL default '1',
rightid tinyint(2) unsigned NOT NULL default '0',
rightvalue tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY unique_key (mod,groupid,siteid,rightid),
KEY select_key (mod,groupid,siteid)
);
Da ist doch der Index select_key eigentlich unnötig, oder? Denn ein UNIQUE KEY ist doch auch ein Index, halt mit dem Zusatz daß noch alles unique ist, oder?