From ea1ae2c1b369f9ac5affbf20c30be1f351133f22 Mon Sep 17 00:00:00 2001 From: Johan Janssens Date: Fri, 10 Jul 2015 03:35:23 +0200 Subject: [PATCH] #222 - Use MyISAM engine for users_sessions table --- install/mysql/schema.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install/mysql/schema.sql b/install/mysql/schema.sql index 36886071a7..561fa24994 100644 --- a/install/mysql/schema.sql +++ b/install/mysql/schema.sql @@ -345,6 +345,11 @@ CREATE TABLE IF NOT EXISTS `users_roles` ( -- -- Table structure for table `session` -- +-- InnoDB tables can make a database slow down if not using incremental primary keys. We are storing the session hash as +-- primary key, which can result in big load times when the table grows. Hence why we use MyISAM for the session table. +-- +-- More info see : http://blog.johnjosephbachir.org/2006/10/22/everything-you-need-to-know-about-designing-mysql-innodb-primary-keys/ +-- CREATE TABLE IF NOT EXISTS `users_session` ( `session_id` varchar(200) NOT NULL DEFAULT '', @@ -357,7 +362,7 @@ CREATE TABLE IF NOT EXISTS `users_session` ( PRIMARY KEY (`session_id`), KEY `userid` (`userid`), KEY `time` (`time`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- --------------------------------------------------------