diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-02 23:34:31 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-10-02 23:34:31 +1100 |
| commit | 55743a77054f1a5a5157856bd2c11751892653d2 (patch) | |
| tree | f714c9366ba12de30d3b810d36286b0b728afb14 | |
| parent | d4f1322ee8fe6055cd96af4145c8f2d2cbbb5f74 (diff) | |
add indexes
| -rw-r--r-- | install.php | 13 | ||||
| -rw-r--r-- | install.sql | 7 | ||||
| -rw-r--r-- | templates/posts.sql | 7 |
3 files changed, 22 insertions, 5 deletions
diff --git a/install.php b/install.php index b701c6d3..26e9b25d 100644 --- a/install.php +++ b/install.php @@ -1,6 +1,6 @@ <?php // Installation/upgrade file - define('VERSION', 'v0.9.3-dev-8'); + define('VERSION', 'v0.9.3-dev-10'); require 'inc/functions.php'; require 'inc/display.php'; @@ -109,6 +109,17 @@ foreach($boards as &$board) { query(sprintf("ALTER TABLE `posts_%s` CHANGE `filename` `filename` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL", $board['uri'])) or error(db_error()); } + case 'v0.9.3-dev-8': + $boards = listBoards(); + foreach($boards as &$board) { + query(sprintf("ALTER TABLE `posts_%s` ADD INDEX ( `thread` )", $board['uri'])) or error(db_error()); + } + case 'v0.9.3-dev-9': + $boards = listBoards(); + foreach($boards as &$board) { + query(sprintf("ALTER TABLE `posts_%s`ADD INDEX ( `time` )", $board['uri'])) or error(db_error()); + query(sprintf("ALTER TABLE `posts_%s`ADD FULLTEXT (`body`)", $board['uri'])) or error(db_error()); + } case false: // Update version number file_write($config['has_installed'], VERSION); diff --git a/install.sql b/install.sql index af5b3f29..210ead99 100644 --- a/install.sql +++ b/install.sql @@ -209,8 +209,11 @@ CREATE TABLE IF NOT EXISTS `posts_b` ( `sticky` int(1) NOT NULL, `locked` int(1) NOT NULL, `embed` text, - UNIQUE KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + UNIQUE KEY `id` (`id`), + KEY `thread` (`thread`), + KEY `time` (`time`), + FULLTEXT KEY `body` (`body`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Dumping data for table `posts_b` diff --git a/templates/posts.sql b/templates/posts.sql index 917398bd..6e691044 100644 --- a/templates/posts.sql +++ b/templates/posts.sql @@ -23,5 +23,8 @@ CREATE TABLE IF NOT EXISTS `posts_{board}` ( `sticky` int(1) NOT NULL, `locked` int(1) NOT NULL, `embed` text, - UNIQUE KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + UNIQUE KEY `id` (`id`), + KEY `thread` (`thread`), + KEY `time` (`time`), + FULLTEXT KEY `body` (`body`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
