Class QueryController
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe maximum number of primary keys we will materialize when performing hybrid vector search. -
Constructor Summary
ConstructorsConstructorDescriptionQueryController(ColumnFamilyStore cfs, ReadCommand command, RowFilter indexFilter, QueryContext queryContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoesNotSelect(PrimaryKey key) Returns whether this query is not selecting thePrimaryKey.getIndexQueryResults(Collection<Expression> expressions) Build aKeyRangeIterator.Builderfrom the given list ofExpressions.getTopKRows(KeyRangeIterator source, QueryViewBuilder.QueryExpressionView queryExpressionView) getTopKRows(QueryViewBuilder.QueryExpressionView queryExpressionView) booleanhasAnalyzer(RowFilter.Expression expression) indexFor(RowFilter.Expression expression) metadata()queryStorage(List<PrimaryKey> keys, ReadExecutionController executionController) queryStorage(PrimaryKey key, ColumnFamilyStore.ViewFragment view, ReadExecutionController executionController) Get an iterator over the row(s) for this primary key.boolean
-
Field Details
-
MAX_MATERIALIZED_KEYS
public static int MAX_MATERIALIZED_KEYSThe maximum number of primary keys we will materialize when performing hybrid vector search. If this limit is exceeded, we switch to an order-by-then-filter execution path
-
-
Constructor Details
-
QueryController
public QueryController(ColumnFamilyStore cfs, ReadCommand command, RowFilter indexFilter, QueryContext queryContext)
-
-
Method Details
-
-
firstPrimaryKeyInRange
-
lastPrimaryKeyInRange
-
metadata
-
indexFilter
-
usesStrictFiltering
public boolean usesStrictFiltering() -
dataRanges
- Returns:
- token ranges used in the read command
-
mergeRange
-
indexFor
-
hasAnalyzer
-
queryStorage
public UnfilteredRowIterator queryStorage(List<PrimaryKey> keys, ReadExecutionController executionController) -
queryStorage
public UnfilteredRowIterator queryStorage(PrimaryKey key, ColumnFamilyStore.ViewFragment view, ReadExecutionController executionController) Get an iterator over the row(s) for this primary key. Restrict the search to the specified view. Apply theSOURCE_TABLE_ROW_TRANSFORMERso that resulting cells have the source memtable/sstable. Expect one row for a fully qualified primary key or all rows within a partition for a static primary key.- Parameters:
key- primary key to fetch from storage.executionController- the executionController to use when querying storage- Returns:
- an iterator of rows matching the query
-
getIndexQueryResults
Build aKeyRangeIterator.Builderfrom the given list ofExpressions.This is achieved by creating an on-disk view of the query that maps the expressions to the
SSTableIndexs that will satisfy the expression.Each
QueryViewBuilder.QueryExpressionViewis then passed toIndexSearchResultIterator.build(QueryViewBuilder.QueryExpressionView, AbstractBounds, QueryContext, boolean, Runnable)to search the in-memory indexes associated with the expression and the SSTable indexes, the results of which are unioned and returned.The results from each call to
IndexSearchResultIterator.build(QueryViewBuilder.QueryExpressionView, AbstractBounds, QueryContext, boolean, Runnable)are added to aKeyRangeIntersectionIteratorand returned if strict filtering is allowed.If strict filtering is not allowed, indexes are split into two groups according to the repaired status of their backing SSTables. Results from searches over the repaired group are added to a
KeyRangeIntersectionIterator, which is then added, along with results from searches on the unrepaired set, to a top-levelKeyRangeUnionIterator, and returned. This is done to ensure that AND queries do not prematurely filter out matches on un-repaired partial updates. Post-filtering must also take this into account. (seeFilterTree.isSatisfiedBy(DecoratedKey, Row, Row)) Note that Memtable-attached indexes are treated as part of the unrepaired set. -
doesNotSelect
Returns whether this query is not selecting thePrimaryKey. The query does not select the key if both of the following statements are false: 1. The table associated with the query is not using clustering keys 2. The clustering index filter for the command wants the row.Item 2 is important in paged queries where the
ClusteringIndexSliceFilterfor subsequent paged queries may not select rows that are returned by the index search because that is initially partition based.- Parameters:
key- ThePrimaryKeyto be tested- Returns:
- true if the key is not selected by the query
-
getTopKRows
public CloseableIterator<PrimaryKeyWithScore> getTopKRows(QueryViewBuilder.QueryExpressionView queryExpressionView) -
getTopKRows
public CloseableIterator<PrimaryKeyWithScore> getTopKRows(KeyRangeIterator source, QueryViewBuilder.QueryExpressionView queryExpressionView)
-