I'm trying to design a database table optimzed for speed that will hold a lot of rows. I will select using "contributor_id" and "approved"
My idea of making it would be something like this:
CREATE TABLE comments (
id int(11) NOT NULL auto_increment,
timestamp int(14) DEFAULT '0' NOT NULL,
contributor_id varchar(10),
INDEX contributor_id (contributor_id),
name varchar(30),
email varchar(50),
ip varchar(15) NOT NULL,
comment varchar(250) NOT NULL,
approved tinyint(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
);
But do I need the column "id"? Couldn't I just make the column "contributor_id" the primary key and still use a index?
Still a newb so any input is appreciated. Thanks.