Class PushdownResult
- All Implemented Interfaces:
SafeCloseable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longLoads and filters a location-level index.static final longFilters an already-materialized location-level index.static final longLoads and uses Bloom filters.static final longLoads and reads a dictionary to determine matches.static final longLoads and uses region metadata (min/max/null_count, etc.).static final longThe entire region contains a single value, so a single read is sufficient to determine matches.static final longBinary searches sorted data.static final longFilters an already-materialized Table-level index.static final longProbes an aggregation's hash table for each match value of a filter on its single key column.static final longThe entire column contains a single in memory value, so a single read is sufficient to determine matches.static final longBinary searches sorted data at the Table-level.static final longThe estimated cost when the filter cannot or should not be pushed down. -
Method Summary
Modifier and TypeMethodDescriptionstatic PushdownResultConstructs a new result with all ofselectionasmatch.static PushdownResultallMaybeMatch(@NotNull RowSet selection) Constructs a new result with all ofselectionasmaybeMatch.voidclose()Closesmatch()andmaybeMatch().copy()Creates a copy ofthis.static PushdownResultexactMatch(@NotNull RowSet selection, @NotNull RowSet match) Constructs a new result withmatchasmatchand nomaybeMatch, so that no residual filter runs over the selection.match()Rows that are known to match.Rows that may match.static PushdownResultConstructs a new result with nomatchnormaybeMatchrows.static PushdownResultConstructs a new result withselection,match, andmaybeMatch.
-
Field Details
-
UNSUPPORTED_ACTION_COST
public static final long UNSUPPORTED_ACTION_COSTThe estimated cost when the filter cannot or should not be pushed down.- See Also:
-
TABLE_SINGLE_VALUE_COLUMN_COST
public static final long TABLE_SINGLE_VALUE_COLUMN_COSTThe entire column contains a single in memory value, so a single read is sufficient to determine matches.Complexity/access: O(1) / In-Memory Data, resolves "yes", "no"
-
TABLE_KEY_LOOKUP_COST
public static final long TABLE_KEY_LOOKUP_COSTProbes an aggregation's hash table for each match value of a filter on its single key column.Complexity/access: O(values) / In-Memory Data, resolves "yes", "no"
-
TABLE_SORTED_DATA_COST
public static final long TABLE_SORTED_DATA_COSTBinary searches sorted data at the Table-level.Complexity/access: O(log(rows)) / In-Memory or Storage Data, resolves "yes", "no"
-
TABLE_IN_MEMORY_DATA_INDEX_COST
public static final long TABLE_IN_MEMORY_DATA_INDEX_COSTFilters an already-materialized Table-level index.Complexity/access: O(rows / 4) / In-Memory Data, resolves "yes", "no"
-
REGION_SINGLE_VALUE_COST
public static final long REGION_SINGLE_VALUE_COSTThe entire region contains a single value, so a single read is sufficient to determine matches. Requires additional overhead in applying the filter (e.g. chunk/context/dummy table creation).Complexity/access: O(regions) / In-Memory Data, resolves "yes", "no"
-
LOCATION_IN_MEMORY_DATA_INDEX_COST
public static final long LOCATION_IN_MEMORY_DATA_INDEX_COSTFilters an already-materialized location-level index. Requires filter copying and initialization per region compared to table-level.Complexity/access: O(rows / 4) / In-Memory Access, resolves "yes", "no"
-
REGION_METADATA_STATS_COST
public static final long REGION_METADATA_STATS_COSTLoads and uses region metadata (min/max/null_count, etc.).Complexity/access: O(regions) / Storage Data, resolves "no", "maybe"
-
REGION_BLOOM_FILTER_COST
public static final long REGION_BLOOM_FILTER_COSTLoads and uses Bloom filters.Complexity/access: O(regions) / Storage Data, resolves "no", "maybe"
-
LOCATION_DEFERRED_DATA_INDEX_COST
public static final long LOCATION_DEFERRED_DATA_INDEX_COSTLoads and filters a location-level index. Requires additional filter copying and initialization per region compared to table-level.Complexity/access: O(rows / 4) / Storage Data, resolves "yes", "no"
-
REGION_SORTED_DATA_COST
public static final long REGION_SORTED_DATA_COSTBinary searches sorted data.Complexity/access: O(log(rows)) / Storage Data, resolves "yes", "no"
-
REGION_DICTIONARY_DATA_COST
public static final long REGION_DICTIONARY_DATA_COSTLoads and reads a dictionary to determine matches.Complexity/access: O(rows) / Storage Data, resolves "yes", "no" for dictionary regions ("maybe" otherwise)
-
-
Method Details
-
allMaybeMatch
Constructs a new result with all ofselectionasmaybeMatch. Semantically equivalent toof(selection, RowSetFactory.empty(), selection), but this method is preferred over that case as no preconditions need to be checked.selectionmust be theselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer).- Parameters:
selection- the selection assigned tomaybeMatch- Returns:
- the result
- See Also:
-
allMatch
Constructs a new result with all ofselectionasmatch. Semantically equivalent toof(selection, selection, RowSetFactory.empty()), but this method is preferred over that case as no preconditions need to be checked.selectionmust be theselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer).- Parameters:
selection- the selection assigned tomatch- Returns:
- the result
- See Also:
-
noneMatch
Constructs a new result with nomatchnormaybeMatchrows. Semantically equivalent toof(selection, RowSetFactory.empty(), RowSetFactory.empty()), but this method is preferred over that case as no preconditions need to be checked.selectionmust be theselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer).- Parameters:
selection- the selection (representing the full "no match" case)- Returns:
- the result
- See Also:
-
exactMatch
public static PushdownResult exactMatch(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet match) Constructs a new result withmatchasmatchand nomaybeMatch, so that no residual filter runs over the selection. Semantically equivalent toof(selection, match, RowSetFactory.empty()), but this method is preferred over that case as the caller need not create and close the empty row set.matchmust be a subset ofselection, andselectionmust be theselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer).- Parameters:
selection- the selectionmatch- rows that match, a subset ofselection- Returns:
- the result
- See Also:
-
of
public static PushdownResult of(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet match, @NotNull @NotNull RowSet maybeMatch) Constructs a new result withselection,match, andmaybeMatch.matchandmaybeMatchmust be non-overlapping subsets ofselection, but this may not be thoroughly checked.selectionmust be theselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer).- Parameters:
selection- the selectionmatch- rows that matchmaybeMatch- rows that might match- Returns:
- the result
-
match
Rows that are known to match. Is asubset oftheselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer). Does notoverlapwithmaybeMatchnornoMatch. Ownership does not transfer to the caller. -
maybeMatch
Rows that may match. Is asubset oftheselectionfromPushdownFilterMatcher.pushdownFilter(WhereFilter, RowSet, boolean, PushdownFilterContext, long, JobScheduler, Consumer, Consumer). Does notoverlapwithmatchnornoMatch. Ownership does not transfer to the caller. -
copy
Creates a copy ofthis.- Returns:
- the copy
-
close
public void close()Closesmatch()andmaybeMatch().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-