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

Why are ranges split into multiple? #33

Open
rynop opened this issue Jul 17, 2019 · 0 comments
Open

Why are ranges split into multiple? #33

rynop opened this issue Jul 17, 2019 · 0 comments

Comments

@rynop
Copy link

rynop commented Jul 17, 2019

When generating the queries to dispatch to DDB, this library goes through all the cells in a covering area, and splits the low and hi range of each cell into sub-ranges based on the hash key length.

I've gone through the logic quite a few times and I can't figure why trySplit() (splitting of cell range into multiple) is needed.

Can't I just take the lowest minimum range of all the cells, and the highest maximum range of all the cells, and construct a DDB BETWEEN condition on the local secondary index?

For example, if my covering had 3 cells and I have a hashKeyLength of 3:

cell 1:
  - rangeMin:    123456789
  - rangeMax    123999999

cell 2:
  - rangeMin:    124000000
  - rangeMax    124999999

cell 3:
  - rangeMin:    125000000
  - rangeMax    125678912

Can't I just do BETWEEN 123456789 and 125678912?

Why do I have to trySplit() cell1s range (123456789-123999999) into 3 separate ranges?

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

No branches or pull requests

1 participant