Repository navigation
Conversation
…tory popup and the central Group View
MyvTsv
marked this pull request as ready for review
November 13, 2026 10:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist before requesting a review
Please delete options that are not relevant.
Description
Performance Optimizations & Benchmark
This update reduces the SQL overhead and eliminates unnecessary HTTP requests generated by the plugin, primarily targeting the ticket form, the full escalation history popup, and the Central Group View.
Key Optimizations
Plugin::isPluginActive()(which triggered 2 queries during plugin initialization) with a lookup against the list of plugins already activated at boot..js.phpfiles (each previously triggering a full GLPI boot of ~24 queries) into static.jsfiles.setup.php, while configuration flags and the two translated labels are injected via<meta>tags—exclusively on the core pages that require them.tickets_idmatching theORDER BYclause.COUNT(DISTINCT)and removed an unusedJOINonglpi_tickets_users.DISTINCT(fixing compatibility issues where the previous query failed under MySQL 8).Session::writeClose()toajax/central.phpandajax/history.phpto release the PHP session lock early and prevent concurrent request blocking.tickets_idindex onglpi_plugin_escalade_histories(e.g., to cover(tickets_id, ...)to match theORDER BY) in a new migration step rather than creating a secondary index. Retaining the original index name ensures earlier migration steps remain idempotent (no-op) and applies seamlessly to existing installations on the next version bump.Benchmark Results
Environment: GLPI 11.0, 2,000 tickets, 50,000 escalation history rows (evenly distributed across two "hot" tickets). Plugin active, debug mode and Xdebug disabled. Values represent the median of 5 runs; SQL counts extracted from the MariaDB query log. (Note: truncated values from the original snippet are marked with
[...]).Benchmark Analysis
glpi_groupslookups drop from 1,250 to 5, and JavaScript console errors per render drop from 1,250 to 0.DOMContentLoadedfrom 250 ms to 217 ms.COUNT/GROUP BYhandling on history rows and requires a separate change.