diff --git a/core/app/Upgrade.php b/core/app/Upgrade.php index df9edc7a..638a1caf 100644 --- a/core/app/Upgrade.php +++ b/core/app/Upgrade.php @@ -95,3 +95,12 @@ function upgrade_step_3() { return wedb::drop_table('{db_prefix}log_boards'); } + +// 1.0-alpha-1, July 2014. Adding index to sessions to prevent a possible slow query. +function upgrade_step_4() +{ + $request = wesql::query(' + ALTER TABLE + {db_prefix}sessions + ADD KEY last_update (last_update)'); +} \ No newline at end of file diff --git a/index.php b/index.php index 9f05bba1..d8fed189 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ return; define('WEDGE_VERSION', '1.0-beta'); -define('WEDGE', 3); // Internal snapshot number. +define('WEDGE', 4); // Internal snapshot number. // Get everything started up... if (version_compare(PHP_VERSION, '5.3') < 0) diff --git a/install/install.sql b/install/install.sql index ac280f47..236033ac 100644 --- a/install/install.sql +++ b/install/install.sql @@ -2068,7 +2068,8 @@ CREATE TABLE {$db_prefix}sessions ( session_id char(32) NOT NULL, last_update int(10) unsigned NOT NULL, data text NOT NULL, - PRIMARY KEY (session_id) + PRIMARY KEY (session_id), + KEY last_update (last_update) ) ENGINE=MyISAM; #