Skip to content

Optimise table joins#6648

Open
WithoutPants wants to merge 5 commits intostashapp:developfrom
WithoutPants:filter-joins
Open

Optimise table joins#6648
WithoutPants wants to merge 5 commits intostashapp:developfrom
WithoutPants:filter-joins

Conversation

@WithoutPants
Copy link
Copy Markdown
Collaborator

Replaces left joins with inner joins where it makes sense to do so (ie where we are checking for the presence of related objects). Left joins are used only where we need to check for null related values.

Also removed the use of trim from the stash ids criterion where clauses.

While the unit tests pass, I will likely defer this until the following release to allow time for potential breakages to appear.

No actual performance comparison testing has been performed yet.

Related to #6455

@WithoutPants WithoutPants added the improvement Something needed tweaking. label Mar 5, 2026
Comment on lines +187 to +188
addJoinTable: func(f *filterBuilder, joinType joinType) {
tagRepository.aliases.leftJoin(f, "", "tags.id")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

joinType is accepted but ignored. Looks like it's always using leftJoin.

@Gykes Gykes added the deferred Good feature that can be looked at for a later release. label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deferred Good feature that can be looked at for a later release. improvement Something needed tweaking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants