Module org.elasticsearch.compute
Enum Class BlockOptimization
- All Implemented Interfaces:
Serializable,Comparable<BlockOptimization>,Constable
Represents the optimization state for block processing in lookup/enrich operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDictionary optimization - input block has ordinals (dictionary-encoded), allowing query deduplication.No optimization - used for LOOKUP JOIN where pages are not merged.Range optimization - no deduplication, positions map 1:1 to input. -
Method Summary
Modifier and TypeMethodDescriptionstatic OrdinalBytesRefBlockextractOrdinalBlock(Page page) Extracts theOrdinalBytesRefBlockfrom block 0 of the given page.static BlockOptimizationReturns the enum constant of this class with the specified name.static BlockOptimization[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No optimization - used for LOOKUP JOIN where pages are not merged.When
mergePagesis false (e.g., LOOKUP JOIN), the lookup service returns multiple pages that are joined byRightChunkedLeftJoinrather than merged byMergePositionsOperator. -
DICTIONARY
Dictionary optimization - input block has ordinals (dictionary-encoded), allowing query deduplication.For ENRICH operations, the input page contains exactly one block: the match field values. When this block is dictionary-encoded (
OrdinalBytesRefBlock), we can optimize by:EnrichQuerySourceOperator: queries only the unique dictionary values instead of all positions, avoiding duplicate queries for repeated match values.MergePositionsOperator: uses the ordinals to map query results back to original positions, expanding the deduplicated results to match the input page's position count.
-
RANGE
Range optimization - no deduplication, positions map 1:1 to input.Used when the input block is not dictionary-encoded (e.g., non-BytesRef types or BytesRef without ordinals). Each input position generates a separate query, and
MergePositionsOperatoruses a simple range[0, positionCount)to map results directly back to input positions without any expansion.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
extractOrdinalBlock
Extracts theOrdinalBytesRefBlockfrom block 0 of the given page. Used when in DICTIONARY optimization mode to access ordinals and dictionary.
-