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

Fixed bug in indexed joins #575

Merged
merged 4 commits into from
Oct 4, 2021
Merged

Fixed bug in indexed joins #575

merged 4 commits into from
Oct 4, 2021

Conversation

zachmu
Copy link
Member

@zachmu zachmu commented Sep 30, 2021

When a query had two copies of the same table, and it could use an index to join them, it was non-deterministic which of the tables' (identical) indexes would be used. This choice doesn't matter for some implementations or even most queries, but in Dolt, if a query involves the same table at two different revisions (because of AS OF), it was arbitrary which table's index got returned. Because the dolt index implementation gets its data from its parent table, if it chose the wrong index it got the wrong data.

This change restricts the choice of index to a single table name.

Need tests demonstrating the bug, but those will have to live in Dolt for the time being.

@zachmu
Copy link
Member Author

zachmu commented Sep 30, 2021

This fixes dolthub/dolt#2189

@zachmu zachmu requested a review from reltuk September 30, 2021 23:49
Copy link
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

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

LGTM!

@zachmu zachmu merged commit 6f684ef into main Oct 4, 2021
@Hydrocharged Hydrocharged deleted the zachmu/index-bug branch December 8, 2021 07:13
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.

2 participants