This issue has been created
 
 
Release Notes Application / cid:jira-generated-image-avatar-8b73f1d8-da4e-4130-801b-38b7cbc05c15 RN-89 Open

getChanges executes its query without a limit and each result is then loaded as a full document

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-698eae69-9f21-4a3e-9488-5938b47a2d35 Vincent Massol created this issue on 31/Aug/26 18:03
 
Summary: getChanges executes its query without a limit and each result is then loaded as a full document
Issue Type: cid:jira-generated-image-avatar-8b73f1d8-da4e-4130-801b-38b7cbc05c15 Bug
Affects Versions: 2.0
Assignee: Unassigned
Components: Application
Created: 31/Aug/26 18:03
Priority: cid:jira-generated-image-static-major-ea5867de-cf09-4936-8d56-4e8c12767afd Major
Reporter: Vincent Massol
Description:

Problem

Code/Change/GetChangesMacro ends with:

#set ($changeItems = $query.execute())

with no setLimit/setOffset. Every ChangeDisplayer* page then loads each row as a full document inside the loop:

#foreach ($item in $changeItems)
  #set ($changeDoc = $xwiki.getDocument($item))

So one call is one unbounded query plus one document load per result.

Consequence

The result-set size is driven by user input: Code/Report forwards the report form's fields straight into getChanges, and the macro's own defaults are versions=% and categories=%. A report submitted with only a product runs one query returning every change of that product ever recorded, then issues one document load per row — thousands on a wiki with years of release notes, in a single request. The Grid displayer additionally resolves attachments per card.

A release note page is also heavier than it looks: Code/Change/ReleaseNotesChangesMacro calls getChanges six times (two per audience section).

Notes

Query#setLimit is already used elsewhere in this application (Code/EntryVelocityMacros), so the fix is local: bound the query, and either page the display or select the needed properties in the query instead of re-loading each document.

See the XWiki performance conventions on preferring pagination over loading an entire unbounded result set.