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

Avoid calculating the sum of items in bitmap statistics #619

Closed
Dr-Emann opened this issue May 1, 2024 · 3 comments
Closed

Avoid calculating the sum of items in bitmap statistics #619

Dr-Emann opened this issue May 1, 2024 · 3 comments

Comments

@Dr-Emann
Copy link
Member

Dr-Emann commented May 1, 2024

Calculating the sum of values requires visiting every item in the bitmap: Other than this, all other statistics can be calculated by only visiting each container. Is it worth either:

  1. Removing the field entirely (breaking change, both API and ABI)
  2. Changing the implementation to leave sum as zero, and documenting that the sum field is not actually updated.

Originally posted by @AviAvni in #617 (comment)

@AviAvni
Copy link
Contributor

AviAvni commented May 1, 2024

we can also provide another api to get a sum just like min and max and it can be optimize for example if we can iterate on ranges for example 1..100 1000..2000 we can just simply calculate (1+100)*100/2+(1000+2000)*1000/2

@lemire
Copy link
Member

lemire commented May 1, 2024

I think it would be an acceptable breaking change.

@Dr-Emann
Copy link
Member Author

Done by #624

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

3 participants