2.3 KiB
SegmentSealed
SegmentSealed has extra interface rather than segment_inferface:
LoadIndex(loadIndexInfo): load the index. indexInfo containsFieldIdIndexParams: index paramters in KV structure KVVecIndex: vector index
LoadFieldData(loadFieldDataInfo): Load column data, could be either scalar column or vector column- Note: indexes and vector data for the same column may coexist. Indexes are prioritized in search
DropIndex(fieldId): drop and release exist index of specified fieldDropFieldData(fieldId): drop and release exist data for specified field
Search is executatble as long as all the column involved in the search are loaded.
SegmentSealedImpl internal data definition
-
row_count_opt_:- Fill row count when load the first entity
- All the other column loaded must match the same row count
-
xxx_ready_bitset_system_ready_count_- Used to record whether the corresponding column is loaded. Bitset corresponds to FieldOffset
- Query is executatble If and only if the following conditions are met:
- system_ready_count_ == 2, which means all the system column RowId/Timestamp is loaded
- The scalar columns involved in the query has been loaded
- For the vector columns involved in the query, either the original data or the index is loaded
-
scalar_indexings_: Store scalar index- Use StructuredSortedIndex in knowhere
-
primary_key_index_: store index for pk column- Use brand new ScalarIndexBase format
- Note,The functions here may overlap with scalar indexes. It is recommended to replace scalar index with ScalarIndexBase
-
field_datas_: store original dataaligned_vector<char>format ganruateeint/floatdata are aligned
-
SealedIndexingRecord vecindexs_: store vector index -
row_ids_/timestamps_: RowId/Timestamp data -
TimestampIndex: Index for Timestamp column -
schema: schema
SegmentSealedImpl internal function dafinion
1.Most functions are the implementation of the corresponding functions of segment interface, which will not be repeated here
2. update_row_count: Used to update the row_count field
3. mask_with_timestamps: Use Timestamp column to update search bitmask,used to support Time Travel function