Feature Wiki
Tabs
Forum: Precalculated statistics to improve performance of thread overview
Page Overview
[Hide]1 Initial Problem
After implementing some prototypes and benchmarks this feature is not necessary (and has not a big impace on the performance).
In ILIAS forums a privileged user can enable the 'Approve Postings' feature. If enabled, moderators have to approve new postings before they are published. This implies that statistics displayed in the thread overview table vary depending on the user's context.
Let's suppose the following example: There are 10 postings in thread B of forum A, but only 7 of 10 have been already approved by moderators. Let's further suppose the ID of the firt posting is 20, and the ID of the last posting is 29. Each posting has different author.
Statistics for moderators:
- Number of postings: 10
- ID of the last posting: 29
- Number of postings: 7
- ID of the last posting: 26
- Number of postings: 8
- ID of the last posting: 27
Nevertheless, this approach has somehow performance issues in huge installations where forums can be quite big.
Source: \ilForum::getAllThreads
1 | SELECT |
2 Conceptual Summary
Therefore we suggest the following changes:
- The number of postings will not be calculated via SQL, a precalculated value for moderators (all postings at all) and non-moderators (all active postings, if the postings have to be approved by moderators) has to be stored in table 'frm_threads'.
- The id and date of the last posting will not be calculated via SQL, precalculated values for moderators (last posting at all) and non-moderators (last active postings, if the postings have to be approved by moderators) have to be stored in table 'frm_threads'.
- If postings have to be approved by moderators, the author of a posting (if not being a moderator) will not his own 'pending' posting anymore.
- The precalculated values have to be refreshed on:
- Creation of new postings
- Deletion of postings
- Enabling/Disabling the 'Approval by moderators' feature
- Approvel by moderators
Furthermore we would like to get rid of the additional LEFT JOIN to table frm_notification. This is currently used to determine if the user has enabled thread-based notification for a result row. We suggest to determine this status by a separate query by using an IN(id1, id2, ...) statement for all thread ids determined for the current table page.
The information is not used for ordering, so we do not necessarily need to query this information in the base SQL query.
3 User Interface Modifications
3.1 List of Affected Views
- Screen-ID: frm/forums_threads/
3.2 User Interface Details
No changes, no details.
3.3 New User Interface Concepts
No changes, no new concepts.
4 Technical Information
4.1 Migration
We MUST provide a new database update step to calculcate ...
- The number of all postings for each thread in the ILIAS database
- The number of all active postings for each thread in the ILIAS database
- The ID and date of the last posting for each thread in the ILIAS database
- The ID and date of the last active posting for each thread in the ILIAS database
5 Contact
- Author of the Request: Jansen, Michael [mjansen]
- Maintainer: Jansen, Michael [mjansen]
- Implementation of the feature is done by: {The maintainer must add the name of the implementing developer.}
6 Funding
If you are interest in funding this feature, please add your name and institution to this list.
- …
7 Discussion
8 Implementation
{The maintainer has to give a description of the final implementation and add screenshots if possible.}
Test Cases
Test cases completed at {date} by {user}
- {Test case number linked to Testrail} : {test case title}
Approval
Approved at {date} by {user}.
Last edited: 19. Sep 2019, 18:08, Jansen, Michael [mjansen]