diff options
| author | Macil Tech <maciltech@gmail.com> | 2012-10-29 22:10:58 -0600 |
|---|---|---|
| committer | Macil Tech <maciltech@gmail.com> | 2013-01-19 00:13:01 -0600 |
| commit | b1c1a25c26ceac45793536c9a4fe903075cc3b63 (patch) | |
| tree | 776b809b1000af5dd3063e837628919cb4124837 | |
| parent | ced540a66ee223ba2e3e2b8dbaaf50e5b48a13d8 (diff) | |
Add (`thread`, `id`) multi-column key to optimize rebuilding index pages.
This SQL command can be used to add the key to existing board tables:
create index `thread_id` on posts_%s (`thread`, `id`);
| -rw-r--r-- | templates/posts.sql | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/templates/posts.sql b/templates/posts.sql index d10749f8..ac383ab0 100644 --- a/templates/posts.sql +++ b/templates/posts.sql @@ -27,6 +27,7 @@ CREATE TABLE IF NOT EXISTS `posts_{{ board }}` ( `embed` text,
UNIQUE KEY `id` (`id`),
KEY `thread` (`thread`),
+ KEY `thread_id` (`thread`, `id`),
KEY `time` (`time`),
FULLTEXT KEY `body` (`body`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
