posted 14 years ago
Hi, all.
Can some one explain to me why in the schema we have both index and key for the same column, for example, in table jforum_forums, we have:
-----------------------------------------------------------------------
CREATE TABLE jforum_forums (
forum_id INT NOT NULL auto_increment,
categories_id INT NOT NULL default '1',
forum_name varchar(150) NOT NULL default '',
forum_desc varchar(255) default NULL,
forum_order INT default '1',
forum_topics INT NOT NULL default '0',
forum_last_post_id INT NOT NULL default '0',
moderated TINYINT(1) DEFAULT '0',
PRIMARY KEY (forum_id),
KEY (categories_id),
INDEX idx_forums_cats (categories_id)
) TYPE=InnoDB;
-------------------------------------------------------------------
We have key and index for categories_id, and they actually are all for index. Can some one explain why we have both of them?
Thank you very much.
David
[originally posted on jforum.net by davidxia]