Class ComposedBitmapIndexAggregate
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.bitmap.ComposedBitmapIndexAggregate
-
@API(EXPERIMENTAL) public class ComposedBitmapIndexAggregate extends Object
Transform a tree of Boolean expressions into a tree of bitwise operations on streams of bitmaps from multipleIndexTypes.BITMAP_VALUE
indexes with common group and position keys. So,AND
turns intoBITAND
andOR
intoBITOR
, with the leaves of the streams being scans of aBITMAP_VALUE
index keyed by the leaf condition. Optional additional grouping predicates for all indexes are also preserved. This means dividing a set of conditions into three categories:- group predicates common to all indexes
- group predicates for a single bitmap index
- position predicates applied to every scan
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<ComposedBitmapIndexAggregate>
tryBuild(QueryPlanner planner, Collection<String> recordTypeNames, IndexAggregateFunctionCall indexAggregateFunctionCall, QueryComponent filter)
Try to build a composed bitmap for the given aggregate function and filters.Optional<RecordQueryPlan>
tryPlan(RecordQueryPlanner planner, RecordQuery.Builder queryBuilder)
Try to turn this composed bitmap into an executable plan.static Optional<RecordQueryPlan>
tryPlan(RecordQueryPlanner planner, RecordQuery query, IndexAggregateFunctionCall indexAggregateFunctionCall)
Try to build a composed bitmap plan for the given query and aggregate function call.
-
-
-
Method Detail
-
tryPlan
@Nonnull public static Optional<RecordQueryPlan> tryPlan(@Nonnull RecordQueryPlanner planner, @Nonnull RecordQuery query, @Nonnull IndexAggregateFunctionCall indexAggregateFunctionCall)
Try to build a composed bitmap plan for the given query and aggregate function call.- Parameters:
planner
- a query planner to use to construct the plansquery
- a query providing target record type, filter, and required fieldsindexAggregateFunctionCall
- the function call giving the desired position and grouping- Returns:
- an
Optional
query plan orOptional.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 plansqueryBuilder
- a prototype query providing target record types and required fields- Returns:
- an
Optional
query plan orOptional.empty
if planning is not possible
-
tryBuild
@Nonnull public static Optional<ComposedBitmapIndexAggregate> tryBuild(@Nonnull QueryPlanner planner, @Nonnull Collection<String> recordTypeNames, @Nonnull IndexAggregateFunctionCall indexAggregateFunctionCall, @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 plansrecordTypeNames
- the record types on which the indexes are definedindexAggregateFunctionCall
- the function giving the desired position and groupingfilter
- conditions on the groups and position- Returns:
- an
Optional
composed bitmap orOptional.empty
if there conditions could not be satisfied
-
-