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

Handle edge case where there is a GSI with the same hash key as primary #362

Merged
merged 1 commit into from
Jun 10, 2019
Merged

Handle edge case where there is a GSI with the same hash key as primary #362

merged 1 commit into from
Jun 10, 2019

Conversation

atyndall
Copy link
Contributor

In the current implementation, when a where query is performed with a hash key and range key that would match a GSI, but the hash key overlaps with the primary index, the GSI is not selected and an expensive Scan is performed instead of the cheap Query.

I ran into this because I wanted to create an index on a different range key without reindexing all the data. This meant the easiest solution was for me to create a GSI with the same hash key as the primary index, but with a different range key. I then encountered this bug.

…rimary index

In the current implementation, when a `where` query is performed with a hash key and range key that would match a GSI, but the hash key overlaps with the primary index, the GSI is not selected and an expensive Scan is performed instead of the cheap Query.
@andrykonchin
Copy link
Member

Looks good 👍

Thank you for the contribution.

@andrykonchin andrykonchin merged commit 0afb3aa into Dynamoid:master Jun 10, 2019
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.

None yet

2 participants