Primary key bad, key good ...

git-svn-id: file:///svn/phpbb/trunk@879 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-08-15 00:54:31 +00:00
parent f8d5fd6422
commit 0bc2d131aa
2 changed files with 65 additions and 56 deletions

View file

@ -286,6 +286,17 @@ CREATE TABLE phpbb_ranks (
#
# Table structure for table 'phpbb_session'
#
# Note that if you're running 3.23.x you may want to make
# this table a type HEAP. This type of table is stored
# within system memory and therefore for big busy boards
# is likely to be noticeably faster than continually
# writing to disk ...
#
# I must admit I read about this type on vB's board.
# Hey, I never said you cannot get basic ideas from
# competing boards, just that I find it's best not to
# look at any code ... !
#
DROP TABLE IF EXISTS phpbb_session;
CREATE TABLE phpbb_session (
session_id char(32) DEFAULT '' NOT NULL,
@ -416,7 +427,6 @@ CREATE TABLE phpbb_topics (
topic_status tinyint(3) DEFAULT '0' NOT NULL,
topic_type tinyint(3) DEFAULT '0' NOT NULL,
topic_last_post_id int(11) DEFAULT '0' NOT NULL,
topic_moved_id int(10),
topic_notify tinyint(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (topic_id),
KEY forum_id (forum_id),
@ -433,7 +443,7 @@ CREATE TABLE phpbb_topics_watch (
topic_id int(11) NOT NULL DEFAULT '0',
user_id int(11) NOT NULL DEFAULT '0',
notify_status tinyint(1) NOT NULL default '0',
PRIMARY KEY (topic_id),
KEY topic_id (topic_id),
KEY user_id (user_id)
);

View file

@ -412,7 +412,6 @@ CREATE TABLE phpbb_topics (
topic_type int2 DEFAULT '0' NOT NULL,
topic_notify int2 DEFAULT '0',
topic_last_post_id int4 DEFAULT '0' NOT NULL,
topic_moved_id int4,
CONSTRAINT phpbb_topics_pkey PRIMARY KEY (topic_id)
);
CREATE INDEX _phpbb_topics_index ON phpbb_topics (forum_id, topic_id);
@ -426,7 +425,7 @@ CREATE TABLE phpbb_topics_watch (
topic_id int4,
user_id int4,
notify_status int2 NOT NULL default '0',
CONSTRAINT phpbb_topics_watch_pkey PRIMARY KEY (topic_id),
KEY topic_id (topic_id),
KEY user_id (user_id)
);
CREATE INDEX _phpbb_topics_watch_index ON phpbb_topics_watch (topic_id, user_id);