加速日度行位置索引查询
This commit is contained in:
@@ -566,7 +566,9 @@ struct SymbolPriceSeries {
|
||||
valid_volume_start_by_count: Vec<usize>,
|
||||
}
|
||||
|
||||
type DenseRowPositionIndex = BTreeMap<NaiveDate, Vec<u32>>;
|
||||
// Row groups keep their chronological BTreeMap for range scans, while the
|
||||
// hot symbol-id lookup uses a hash index to avoid a tree traversal per row.
|
||||
type DenseRowPositionIndex = AHashMap<NaiveDate, Vec<u32>>;
|
||||
|
||||
const MISSING_ROW_POSITION: u32 = u32::MAX;
|
||||
const MAX_DENSE_ROW_INDEX_BYTES: usize = 256 * 1024 * 1024;
|
||||
@@ -4048,7 +4050,7 @@ fn build_dense_row_positions<T>(
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut positions_by_date = BTreeMap::new();
|
||||
let mut positions_by_date = AHashMap::new();
|
||||
for (date, rows) in groups {
|
||||
let symbol_ids = symbol_ids_by_date.get(date)?;
|
||||
if rows.len() != symbol_ids.len() {
|
||||
|
||||
Reference in New Issue
Block a user