Database: reduce varchar cols to fit MyISAM indexes
MyISAM indexes are limited to 1000 bytes per index. Recently, Linux distros (e.g. Debian 9) started to default MariaDB installations to utf8mb4, which can use up to 4 bytes per character. Hence, two varchar columns indexed in a single key have a total maximum length of 250. Instead, we use some lower, round numbers. Change-Id: I4b53bc217912bc7070102a0af4938763e61b041d
This commit is contained in:
@ -145,8 +145,8 @@ bool Database::create_variants_table()
|
||||
{
|
||||
if (!query("CREATE TABLE IF NOT EXISTS variant ("
|
||||
" id int(11) NOT NULL AUTO_INCREMENT,"
|
||||
" variant varchar(255) NOT NULL,"
|
||||
" benchmark varchar(255) NOT NULL,"
|
||||
" variant varchar(100) NOT NULL,"
|
||||
" benchmark varchar(100) NOT NULL,"
|
||||
" PRIMARY KEY (id),"
|
||||
"UNIQUE KEY variant (variant,benchmark)) ENGINE=MyISAM")) {
|
||||
return false;
|
||||
@ -244,7 +244,7 @@ int Database::get_fspmethod_id(const std::string &method)
|
||||
{
|
||||
if (!query("CREATE TABLE IF NOT EXISTS fspmethod ("
|
||||
" id int(11) NOT NULL AUTO_INCREMENT,"
|
||||
" method varchar(255) NOT NULL,"
|
||||
" method varchar(100) NOT NULL,"
|
||||
" PRIMARY KEY (id), UNIQUE KEY method (method)) ENGINE=MyISAM")) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user