Repository navigation
Conversation
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.
Test data
GLPI 11.0 (
11.0/bugfixes), e2e database, plugin 1.20.4, debug mode and Xdebug off. Data injected in SQL:The assets are spread unevenly: 20 % in one location (2000, about 4 400 assets), 30 % in 19 other hot locations, 50 % one per type in the other locations.
Test scenarios
Each scenario: 1 warm-up run, then 5 measured runs (medians). SQL counted from the MariaDB log in a separate pass. Five other plugins stay active in both states.
index.php)Problems found
left.phprunsSELECT completename FROM glpi_locations WHERE id = ?once per asset type of every open location, and never uses the result: 44 of the 138 queries of a typical location.SELECT *on 11 wide asset tables while only the id, the name and the inventory number are read.treeview.cssis loaded on every GLPI page, but only the tree frame uses it.glpi_plugin_treeview_preferences.users_idhas no index: each login and profile change scans the whole table.plugin_init_treeview()instantiates the 11 asset classes on every request to register the item hooks.Fixes
completenamequery and the CSRF token from the search links.id,nameandotherserial(when the table has it).ADD_CSShook, and linktreeview.cssfromleft.php.users_idkey to the preferences table (CREATE TABLEand an idempotentMigration::addKeyfor existing installs).The tree output is unchanged: same nodes, byte for byte, on the four tree scenarios.
Results
completenamequeries