Skip to content

Commit

Permalink
Merge pull request #1970 from mahagr/master
Browse files Browse the repository at this point in the history
Fix #1969: Improve performance of daily statistics (DB key change)
  • Loading branch information
mahagr committed Oct 1, 2013
2 parents 5fbeb43 + 17c6357 commit e11b8ef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Expand Up @@ -399,7 +399,13 @@
<version version="2.0.3" versiondate="2012-11-24" versionname="Reconciliation">
<query>UPDATE `#__kunena_topics` SET hold='4' WHERE first_post_id='0'</query>
</version>
<version version="@kunenaversion@" versiondate="@kunenaversiondate@" versionname="@kunenaversionname@">
<version version="3.0.3" versiondate="@kunenaversiondate@" versionname="Bifrost">
<query mode="silenterror">ALTER TABLE `#__kunena_messages` DROP INDEX `time`;</query>
<query mode="silenterror">ALTER TABLE `#__kunena_messages` DROP INDEX `hold_time`;</query>
<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD INDEX `time_hold` ( `time` , `hold` );</query>
<query mode="silenterror">ALTER TABLE `#__kunena_messages` ADD INDEX `hold` ( `hold` );</query>
</version>
<version version="@kunenaversion@" versiondate="@kunenaversiondate@" versionname="@kunenaversionname@">
</version>
</upgrade>
</comupgrade>
Expand Up @@ -155,11 +155,11 @@ CREATE TABLE IF NOT EXISTS `#__kunena_messages` (
KEY `thread` (thread),
KEY `ip` (ip),
KEY `userid` (userid),
KEY `time` (time),
KEY `locked` (locked),
KEY `hold_time` (hold,time),
KEY `parent_hits` (parent,hits),
KEY `catid_parent` (catid,parent) ) DEFAULT CHARACTER SET utf8;
KEY `catid_parent` (catid,parent),
KEY `time_hold` (time,hold),
KEY `hold` (hold)) DEFAULT CHARACTER SET utf8;

CREATE TABLE IF NOT EXISTS `#__kunena_messages_text` (
`mesid` int(11) NOT NULL default '0',
Expand Down
@@ -0,0 +1,7 @@
-- Kunena 2.0.3 => 3.0.3

-- Optimize counting of daily activity statistics.
ALTER TABLE `#__kunena_messages` DROP INDEX `time`;
ALTER TABLE `#__kunena_messages` DROP INDEX `hold_time`;
ALTER TABLE `#__kunena_messages` ADD INDEX `time_hold` ( `time` , `hold` );
ALTER TABLE `#__kunena_messages` ADD INDEX `hold` ( `hold` );

0 comments on commit e11b8ef

Please sign in to comment.