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

Improved support for large andNot queries #513

Open
richardstartin opened this issue Aug 21, 2021 · 0 comments
Open

Improved support for large andNot queries #513

richardstartin opened this issue Aug 21, 2021 · 0 comments

Comments

@richardstartin
Copy link
Member

It should be possible to optimise the following aggregation significantly by not requiring materialisation of the contiguous bitmap and by reusing intermediate containers during the aggregation (like FastAggregation.workShyAnd does):

// one API option:
RoaringBitmap foo(long min, long max, RoaringBitmap[] bitmaps) {
    RoaringBitmap result = new RoaringBitmap();
    result.add(min, max);
    for (RoaringBitmap bitmap : bitmaps) {
       result.andNot(bitmap);
    }
   return result;
}

// another API option:
RoaringBitmap bar(long min, long max, RoaringBitmap[] bitmaps) {
    RoaringBitmap union = new RoaringBitmap();
    for (RoaringBitmap bitmap : bitmaps) {
       union.or(bitmap);
    }
    RoaringBitmap result = new RoaringBitmap();
    result.add(min, max);
    result.andNot(union);
    return result;
}

There would be a method added to FastAggregation:

RoaringBitmap rangeAndNot(long min, long max, RoaringBitmap... bitmaps);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant