Loading...
 

Score Feature - Slow Database Queries

Status
Open
Subject
Score Feature - Slow Database Queries
Version
15.x
Category
  • Error
Feature
Score
Resolution status
New
Submitted by
albertgi
Lastmod by
albertgi
Rating
(0)
Description

It seems that the greater the number of users exist in the wiki, tied with a higher total score per user, generates very slow queries to the database, resulting in a very slow load time per page. I was experiencing 20 seconds + of load time per wiki page, as it was loading the scoring table every time.

Some samples from the database (not sure if useful).

  1. Time: 170131 16:54:54
  2. User@Host: giswikiadmgiswikiadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 334497
  3. Query_time: 28.076675 Lock_time: 0.000208 Rows_sent: 10 Rows_examined: 4229506

SET timestamp=1485899694;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. User@Host: eiadwikiadmeiadwikiadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344609
  2. Query_time: 21.994789 Lock_time: 0.000448 Rows_sent: 10 Rows_examined: 3325313

SET timestamp=1485955286;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. Time: 170201 8:21:56
  2. User@Host: eiadwikiadmeiadwikiadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344614
  3. Query_time: 22.215687 Lock_time: 0.000448 Rows_sent: 10 Rows_examined: 3325313

SET timestamp=1485955316;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. Time: 170201 8:22:42
  2. User@Host: eiadwikiadmeiadwikiadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344620
  3. Query_time: 21.846001 Lock_time: 0.000245 Rows_sent: 10 Rows_examined: 3325313

SET timestamp=1485955362;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. Time: 170201 8:23:33
  2. User@Host: citypediaadmcitypediaadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344638
  3. Query_time: 12.665043 Lock_time: 0.000552 Rows_sent: 10 Rows_examined: 2035464

use citypediap1;
SET timestamp=1485955413;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. Time: 170201 8:23:44
  2. User@Host: eiadwikiadmeiadwikiadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344639
  3. Query_time: 22.066348 Lock_time: 0.000236 Rows_sent: 10 Rows_examined: 3325313

use eiadwikip1;
SET timestamp=1485955424;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

  1. Time: 170201 8:23:52
  2. User@Host: citypediaadmcitypediaadm @ clwp001.city.a.ottawa.ca 10.140.12.238 Id: 344642
  3. Query_time: 13.027229 Lock_time: 0.000440 Rows_sent: 10 Rows_examined: 2035464

use citypediap1;
SET timestamp=1485955432;
select `recipientObjectId` as `login`,
`pointsBalance` as `score`
from `tiki_object_scores` tos
where `recipientObjectType`='user'
and tos.`id` = (select max(id) from `tiki_object_scores` where `recipientObjectId` = tos.`recipientObjectId` and `recipientObjectType`='user' group by `recipientObjectId`)
group by `recipientObjectId` order by `score` desc LIMIT 10 OFFSET 0;

Workaround
Disabled the score module
Importance
6
Demonstrate Bug
Please demonstrate your bug on show2.tikiwiki.org

 About show2.tikiwiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tikiwiki.org instance. To start, simply select a version and click on "Create show2.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tikiwiki.org.

Version: Create show2.tikiwiki.org instance
Rating (deprecated)
(0)
Ticket ID
6271
Created
Thursday 02 February, 2017 16:16:15 GMT-0000
LastModif
Thursday 02 February, 2017 16:16:15 GMT-0000

Attachments

 filenamecreatedhitscommentversionfiletype 
No attachments for this item


Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Group
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend, alert + Social Bookmarking
Terms and Conditions
Theme
TikiTests
Timesheet
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools