Class ComposedBitmapIndexAggregate
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.bitmap.ComposedBitmapIndexAggregate
-
public class ComposedBitmapIndexAggregate extends Object
Transform a tree of Boolean expressions into a tree of bitwise operations on streams of bitmaps. 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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<ComposedBitmapIndexAggregate>
tryBuild(RecordQueryPlanner planner, Collection<String> recordTypeNames, IndexAggregateFunction indexAggregateFunction, QueryComponent filter)
Try to build a composed bitmap for the given aggregate function and filters.Optional<ComposedBitmapIndexQueryPlan>
tryPlan(RecordQueryPlanner planner, RecordQuery.Builder queryBuilder)
Try to turn this composed bitmap into an executable plan.static Optional<ComposedBitmapIndexQueryPlan>
tryPlan(RecordQueryPlanner planner, RecordQuery query, IndexAggregateFunction indexAggregateFunction)
Try to build a composed bitmap plan for the given query and aggregate function.
-
-
-
Method Detail
-
tryPlan
@Nonnull public static Optional<ComposedBitmapIndexQueryPlan> 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 plansquery
- a query providing target record type, filter, and required fieldsindexAggregateFunction
- the function giving the desired position and grouping- Returns:
- an
Optional
query plan orOptional.empty
if planning is not possible
-
tryPlan
@Nonnull public Optional<ComposedBitmapIndexQueryPlan> 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 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 plansrecordTypeNames
- the record types on which the indexes are definedindexAggregateFunction
- 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
-
-