Skip to content

Inverted FK direction from Resource to StoredData to fix N+1 on resource search list. - #577

Merged
tdipisa merged 3 commits into
masterfrom
fix-resource-data-n+1
Aug 11, 2026
Merged

Inverted FK direction from Resource to StoredData to fix N+1 on resource search list.#577
tdipisa merged 3 commits into
masterfrom
fix-resource-data-n+1

Conversation

@axl8713

@axl8713 axl8713 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

These changes address the issue reported here, where a N+1 problem emerged when listing Resources; all the StoredData associated with Resources were loaded even with includeData=false, causing a performance drop for long lists of resources.

@axl8713

axl8713 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@offtherailz How to name the SQL migration scripts? Should they reflect an older version?

@axl8713
axl8713 marked this pull request as draft July 9, 2026 12:15
@axl8713
axl8713 force-pushed the fix-resource-data-n+1 branch from 5824552 to aa4eb8f Compare July 9, 2026 12:26
@axl8713
axl8713 marked this pull request as ready for review July 9, 2026 12:26
@tdipisa tdipisa added this to the 2.6.1 milestone Jul 9, 2026
@tdipisa
tdipisa marked this pull request as draft July 9, 2026 14:45
@tdipisa
tdipisa marked this pull request as ready for review July 9, 2026 14:45
@tdipisa

tdipisa commented Jul 9, 2026

Copy link
Copy Markdown
Member

@axl8713 please let's wait 2.6.0 to be released before merging the backport of this one.

@tdipisa
tdipisa removed the request for review from offtherailz July 9, 2026 14:46
@afabiani afabiani assigned axl8713 and unassigned afabiani Aug 3, 2026
@axl8713

axl8713 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@tdipisa Waiting confirmation about migration scripts version numbers before merging.

@tdipisa

tdipisa commented Aug 11, 2026

Copy link
Copy Markdown
Member

@tdipisa Waiting confirmation about migration scripts version numbers before merging.

@axl8713 the following is fine as it follows the same naming convention followed so far.

doc/sql/migration/xxx/xxx-migration-from-v.2.4.1-to-v2.6.1.sql

going to merge...

@axl8713 please create an issue to connect to this PR for tests.

@tdipisa
tdipisa merged commit 34f33a8 into master Aug 11, 2026
3 checks passed
@offtherailz

Copy link
Copy Markdown
Member

Created backport PR for 2.6.x:

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

git fetch origin backport-577-to-2.6.x
git worktree add --checkout .worktree/backport-577-to-2.6.x backport-577-to-2.6.x
cd .worktree/backport-577-to-2.6.x
git reset --hard HEAD^
git cherry-pick -x 34f33a807e280dcbc75bca39ea955876b234dbc4
git push --force-with-lease

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.

4 participants