index db fields for faster lookup. SQL for updating existing table: "ALTER TABLE pastes ADD INDEX (pid), ADD INDEX (private), ADD INDEX (replyto), ADD INDEX (created)"

This commit is contained in:
Claude 2012-04-23 16:55:59 +02:00
parent 3c9cc51af3
commit c04a55d46b

View File

@ -120,6 +120,10 @@ class Main extends CI_Controller
); );
$this->dbforge->add_field($fields); $this->dbforge->add_field($fields);
$this->dbforge->add_key('id', true); $this->dbforge->add_key('id', true);
$this->dbforge->add_key('pid');
$this->dbforge->add_key('private');
$this->dbforge->add_key('replyto');
$this->dbforge->add_key('created');
$this->dbforge->create_table('pastes', true); $this->dbforge->create_table('pastes', true);
} }
} }