summaryrefslogtreecommitdiff
path: root/sql-files
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-13 01:07:45 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-13 01:07:45 +0000
commit6ce3e3bc0de4fe7faf2c7bed6e0b2d234b241f12 (patch)
tree9a9982616eb55cbcc353207521c370d0c1dad16b /sql-files
parentef2ebfc6da2dac054af7dfe206bf1ea9906435ea (diff)
downloadhercules-6ce3e3bc0de4fe7faf2c7bed6e0b2d234b241f12.tar.gz
hercules-6ce3e3bc0de4fe7faf2c7bed6e0b2d234b241f12.tar.bz2
hercules-6ce3e3bc0de4fe7faf2c7bed6e0b2d234b241f12.tar.xz
hercules-6ce3e3bc0de4fe7faf2c7bed6e0b2d234b241f12.zip
- Modified the login SQL server so that case insensitive lookups use "where name = BINARY 'name'" instead of "where BINARY name = 'name'", since this way the name index should be used, and performance will no longer be heavily affected.
- Modified main.sql to add 4 missing indexes (thanks to ErkDog): char_id on the tables memo/friends, and online/name on the char table. Added upgrade_svn8728.sql to add these indexes to already existing tables. - Changed back the default of case-sensitive to ON since it shouldn't be such a bad performance hog now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8728 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'sql-files')
-rw-r--r--sql-files/main.sql10
-rw-r--r--sql-files/upgrade_svn8728.sql4
2 files changed, 11 insertions, 3 deletions
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 2edb747e3..155542119 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -81,7 +81,9 @@ CREATE TABLE `char` (
PRIMARY KEY (`char_id`),
KEY `account_id` (`account_id`),
KEY `party_id` (`party_id`),
- KEY `guild_id` (`guild_id`)
+ KEY `guild_id` (`guild_id`),
+ KEY `name` (`name`),
+ KEY `online` (`online`)
) TYPE=MyISAM AUTO_INCREMENT=150000;
--
@@ -113,7 +115,8 @@ DROP TABLE IF EXISTS `friends`;
CREATE TABLE `friends` (
`char_id` int(11) NOT NULL default '0',
`friend_account` int(11) NOT NULL default '0',
- `friend_id` int(11) NOT NULL default '0'
+ `friend_id` int(11) NOT NULL default '0',
+ KEY `char_id` (`char_id`)
) TYPE=MyISAM;
--
@@ -461,7 +464,8 @@ CREATE TABLE `memo` (
`map` varchar(255) NOT NULL default '',
`x` smallint(9) unsigned NOT NULL default '0',
`y` smallint(9) unsigned NOT NULL default '0',
- PRIMARY KEY (`memo_id`)
+ PRIMARY KEY (`memo_id`),
+ KEY `char_id` (`char_id`)
) TYPE=MyISAM;
--
diff --git a/sql-files/upgrade_svn8728.sql b/sql-files/upgrade_svn8728.sql
new file mode 100644
index 000000000..71558893f
--- /dev/null
+++ b/sql-files/upgrade_svn8728.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `friends` ADD INDEX ( `char_id` );
+ALTER TABLE `memo` ADD INDEX ( `char_id` );
+ALTER TABLE `char` ADD INDEX ( `name` );
+ALTER TABLE `char` ADD INDEX ( `online` );