Skip to content

pkp/pkp-lib#12670 Build the sitemap book, chapter and file URLs with batched queries - #2546

Closed
mesutk wants to merge 1 commit into
pkp:mainfrom
mesutk:i12670-main
Closed

mesutk wants to merge 1 commit into
pkp:mainfrom
mesutk:i12670-main

Conversation

@mesutk

@mesutk mesutk commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Fixes pkp/pkp-lib#12670 on main.

Same change as #2545 (stable-3_5_0), which has the details and the measurements. pages/sitemap/SitemapHandler.php is the same on both branches, and so is the code the change relies on: Collector::getIds(), the submission file Collector's filterByAssoc() and filterBySubmissionIds(), Submission::getBestId() and getLatestPublication(), Chapter::isPageEnabled(), PublicationFormatDAO::getApprovedByPublicationId() and SubmissionFile::getBestId().

On main, Submission::fromRow() already loads the publications of a batch of submissions together, but each publication still loads its chapters and formats one by one, and the files are still queried once per format, so the issue applies here too. I have not measured it on main.

Prepared with AI assistance (Claude); tested on stable-3_5_0 as described in #2545.

…batched queries

Loading every published submission hydrated each publication with its chapters,
formats, DOIs and contributors, and the files were queried once per format
(about 60 queries per book). Read only the ids and URL paths the sitemap needs,
1000 submissions at a time.
@bozana

bozana commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Closed in favour of #2577, which includes this commit (pkp/pkp-lib#13789). Thanks!

@bozana bozana closed this Nov 20, 2026
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.

[OMP] Sitemap rendering issues ~40,000 DB queries on a 1k-book press due to per-row Publication entity hydration

2 participants