Class ComposedBitmapIndexAggregate


  • @API(EXPERIMENTAL)
    public class ComposedBitmapIndexAggregate
    extends Object
    Transform a tree of Boolean expressions into a tree of bitwise operations on streams of bitmaps. So, AND turns into BITAND and OR into BITOR, with the leaves of the streams being scans of a BITMAP_VALUE index keyed by the leaf condition. Optional additional grouping predicates for all indexes are also preserved.
    • Method Detail

      • tryPlan

        @Nonnull
        public static Optional<RecordQueryPlan> tryPlan​(@Nonnull
                                                        RecordQueryPlanner planner,
                                                        @Nonnull
                                                        RecordQuery query,
                                                        @Nonnull
                                                        IndexAggregateFunction indexAggregateFunction)
        Try to build a composed bitmap plan for the given query and aggregate function.
        Parameters:
        planner - a query planner to use to construct the plans
        query - a query providing target record type, filter, and required fields
        indexAggregateFunction - the function giving the desired position and grouping
        Returns:
        an Optional query plan or Optional.empty if planning is not possible
      • tryPlan

        @Nonnull
        public Optional<RecordQueryPlan> tryPlan​(@Nonnull
                                                 RecordQueryPlanner planner,
                                                 @Nonnull
                                                 RecordQuery.Builder queryBuilder)
        Try to turn this composed bitmap into an executable plan.
        Parameters:
        planner - a query planner to use to construct the plans
        queryBuilder - a prototype query providing target record types and required fields
        Returns:
        an Optional query plan or Optional.empty if planning is not possible
      • tryBuild

        @Nonnull
        public static Optional<ComposedBitmapIndexAggregate> tryBuild​(@Nonnull
                                                                      RecordQueryPlanner planner,
                                                                      @Nonnull
                                                                      Collection<String> recordTypeNames,
                                                                      @Nonnull
                                                                      IndexAggregateFunction indexAggregateFunction,
                                                                      @Nonnull
                                                                      QueryComponent filter)
        Try to build a composed bitmap for the given aggregate function and filters.

        The function should use a supported aggregate function (currently "bitmap_value") and the bitmap-indexed position field grouped by any common fields. The filter should supply equality conditions to the common fields. The filter can include additional equality conditions on various other fields for which there are appropriate bitmap indexes, in a Boolean expression that will be transformed into a set the corresponding bit operations on the bitmaps. The filter can also include range conditions on the position field.

        Parameters:
        planner - a query planner to use to construct the plans
        recordTypeNames - the record types on which the indexes are defined
        indexAggregateFunction - the function giving the desired position and grouping
        filter - conditions on the groups and position
        Returns:
        an Optional composed bitmap or Optional.empty if there conditions could not be satisfied