Skip to content

Conversation

@geominorai
Copy link
Contributor

@geominorai geominorai commented Aug 29, 2020

Description

Added two indices to the {prefix}_bans table and split the subquery for the ban history count into two on the ban list page.

Motivation and Context

Current ban history count subquery does not scale with a large number of rows in {prefix}_bans table and stalls ban list page load.

How Has This Been Tested?

Environment: Linux server running Apache with PHP 7.2 + MySQL 5.7.27

Load times on the ban list page while having 3.6k total bans have now been reduced from around 13 seconds to 1.
Please advise on the version number bump and updater file changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

@geominorai
Copy link
Contributor Author

geominorai commented Aug 29, 2020

Additional info from experiments:

  • Adding a single index containing the three columns while keeping the query as-is had no effect on the page load time.
  • Neither did adding a separate index for each of the three columns.

@Groruk Groruk merged commit 458ad21 into sbpp:v1.x Sep 3, 2020
@geominorai geominorai deleted the patch/banlist-speedup branch September 3, 2020 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants