Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Return correct results from one-many indexed filter #2579

Merged

Conversation

AndrewSisley
Copy link
Contributor

@AndrewSisley AndrewSisley commented May 2, 2024

Relevant issue(s)

Resolves #2574

Description

Return correct results from one-many joins filtered on an indexed field on the many side.

The invertibleTypeJoin doesn't support the inversion of one-many joins and was converting them into one-one joins.

This means that the index is no longer used if targeting the many side: #2578 (this support can be added after the release).

@AndrewSisley AndrewSisley added bug Something isn't working area/query Related to the query component labels May 2, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.11 milestone May 2, 2024
@AndrewSisley AndrewSisley requested a review from a team May 2, 2024 14:40
@AndrewSisley AndrewSisley self-assigned this May 2, 2024
It is annoying to have to keep commenting bits out in order to test one thing, now (ignoring explain) we can test one thing at a time.
So that I can read it, and adjust it to what is under test.  I don't know what the original test data was, so it has also been adjusted in this commit.
Like the multi-query test function, having to comment out the explain query in order to test one thing at a time is annoying.
Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for fixing this and the added tests.

@AndrewSisley AndrewSisley merged commit 43cbf47 into sourcenetwork:develop May 3, 2024
27 of 28 checks passed
@AndrewSisley AndrewSisley deleted the 2574-index-broken-test branch May 3, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestQueryWithIndexOnOneToTwoRelation_IfFilterOnIndexedRelation_ShouldFilter is incorrect
2 participants