Skip to content

AO3-7356 Reduce N+1 queries on series show page#5668

Merged
sarken merged 3 commits into
otwcode:masterfrom
Bilka2:AO3-7356-series-show-n-plus-one
May 3, 2026
Merged

AO3-7356 Reduce N+1 queries on series show page#5668
sarken merged 3 commits into
otwcode:masterfrom
Bilka2:AO3-7356-series-show-n-plus-one

Conversation

@Bilka2

@Bilka2 Bilka2 commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Issue

https://otwarchive.atlassian.net/browse/AO3-7356

Purpose

Remove N+1 queries related to pseuds and users on the series show page. There are still N+1 queries for chapters, but I couldn't figure out how to remove those (refer to code comment). And this already helps a lot.

Failing test pushed first to show it's testing the right thing.

Credit

Bilka

@github-actions github-actions Bot added Scope: Tests Only Only changes automated tests or test configuration Awaiting Review labels Mar 25, 2026
else
@page_title = get_page_title(@series.fandoms.pluck(:name).join(t("support.array.words_connector")),
@series.anonymous? ? t(".anonymous") : @series.allpseuds.collect(&:byline).join(t("support.array.words_connector")),
helpers.text_byline(@series),

@Bilka2 Bilka2 Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This somewhat changes the format, as previously the browser title only grabbed pseuds from the works, but the byline also grabs them from the series itself. But now it matches the list of creators on the actual page, which I think is better. And this code is cached and also more efficient, so it feels like a very obvious solution

@Bilka2 Bilka2 removed the Scope: Tests Only Only changes automated tests or test configuration label Mar 25, 2026
@sarken sarken merged commit 5b9fff9 into otwcode:master May 3, 2026
29 checks passed
@Bilka2 Bilka2 deleted the AO3-7356-series-show-n-plus-one branch May 25, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants