Raised This Month: $32 Target: $400
 8% 

Bug Report Banlist slow loading query on recent MYSQL versions


Post New Thread Reply   
 
Thread Tools Display Modes
theChaosCoder
Junior Member
Join Date: Oct 2015
Old 11-09-2016 , 08:09   Re: Banlist slow loading query on recent MYSQL versions
Reply With Quote #21

The index is just a lookup table for a field (or multiple fields). You can name it like you want. It's not really important for our case. If you query like Select .... where auth = "abc" then mysql don't need to scan the entire table but can look up the value very fast by performing something like a binary search. You can also check if an index is used by your query by adding EXPLAIN before the SELECT statement ;)

Btw, the struct.sql file (located in /install/includes) have a FULLTEXT index.

....
PRIMARY KEY (`bid`),
KEY `sid` (`sid`),
FULLTEXT KEY `reason` (`reason`),
FULLTEXT KEY `authid_2` (`authid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


p.s. You could try to switch to innoDB if you have a recent mysql version installed. InnoDB is now very fast, ACID compatible, supports also fulltext search and is locking only the row on update / (also insert?) rather then the entire table. Also they don't really work on myisam anymore...

Last edited by theChaosCoder; 11-09-2016 at 08:18.
theChaosCoder is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-14-2016 , 18:25   Re: Banlist slow loading query on recent MYSQL versions
Reply With Quote #22

i use innodb, have index built for everything that gets compared/whered
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode