Skip to content

[main] Fix(Perf): index order lines, check budget in one query and stop re-r… - #634

Draft
glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/631-to-main
Draft

glpi-project[bot] wants to merge 1 commit into
mainfrom
forward-port/631-to-main

Conversation

@glpi-project

@glpi-project glpi-project Bot commented Nov 19, 2026

Copy link
Copy Markdown

Forward-port of #631 to main.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • Instance: GLPI 11.0 (e2e environment), order 2.12.12, debug mode off
  • Data: 2 000 computers, 20 budgets, 200 references, 5 000 orders, 51 180 order lines, 2 000 bills; one budget with 500 orders, one order with 1 000 units (600 delivered), one order with 50 references and 50 bills
  • Measured scenarios: central page, Management tab of an ordered computer and its save, order form, order detail, reception, associated items and bills tabs, orders tab of a budget and of a supplier, order list
  • Measurement method: median of 5 runs after a warm-up (browser Performance API); SQL from the MariaDB slow log at a zero threshold
  • SQL: index on glpi_plugin_order_orders_items.plugin_order_orders_id and glpi_plugin_order_orders.budgets_id (install and migration); over-budget check in one query instead of one SUM per order of the budget; reception tab uses the loaded line status instead of reading each line twice; bills tab and budget tab read bills, names and prices once; no isActivated() at init

SQL Queries

Scenario Without plugin Before After Difference
Order form (budget with 500 orders) - 652 149 -77.1 %
Order form, rows examined - 25 854 871 16 148 -99.9 %
Reception tab (1 000 units) - 3 036 106 -96.5 %
Bills tab (50 references) - 906 315 -65.2 %
Budget orders tab, rows examined - 1 038 484 7 019 -99.3 %
Order detail tab, rows examined - 215 459 13 974 -93.5 %
Management tab of an ordered computer 136 150 146 -2.7 %
glpi_plugins per request 8 12 10 -2

Response Times

Scenario Before After Difference
Order form (server) 1 990 ms 29 ms -98.5 %
Reception tab (server) 109 ms 50 ms -54.3 %
Bills tab (server) 88 ms 42 ms -52.6 %
Budget orders tab (server) 110 ms 26 ms -76.5 %

@glpi-project

glpi-project Bot commented Nov 19, 2026

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin forward-port/631-to-main
git worktree add --checkout .worktree/forward-port/631-to-main forward-port/631-to-main
cd .worktree/forward-port/631-to-main
git reset --hard HEAD^
git cherry-pick -x 880912c88363f0a086db585a3cd519b1c36b03ad

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.

1 participant