Skip to content

Commit 4bb13c7

Browse files
committed
fix
1 parent 4a3c446 commit 4bb13c7

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/query/storages/fuse/src/io/write/vector_index_writer.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ use databend_storages_common_index::HNSWIndex;
3737
use databend_storages_common_table_meta::meta::Location;
3838
use databend_storages_common_table_meta::table::TableCompression;
3939

40+
const DEFAULT_M: usize = 16;
41+
const DEFAULT_EF_CONSTRUCT: usize = 100;
42+
4043
#[derive(Debug, Clone)]
4144
pub struct VectorIndexState {
4245
pub location: Location,
@@ -106,13 +109,13 @@ impl VectorIndexBuilder {
106109

107110
// Parse index parameters
108111
let m = match index.options.get("m") {
109-
Some(value) => value.parse::<usize>().unwrap_or(16),
110-
None => 16,
112+
Some(value) => value.parse::<usize>().unwrap_or(DEFAULT_M),
113+
None => DEFAULT_M,
111114
};
112115

113116
let ef_construct = match index.options.get("ef_construct") {
114-
Some(value) => value.parse::<usize>().unwrap_or(64),
115-
None => 64,
117+
Some(value) => value.parse::<usize>().unwrap_or(DEFAULT_EF_CONSTRUCT),
118+
None => DEFAULT_EF_CONSTRUCT,
116119
};
117120

118121
let mut distances = Vec::new();

tests/sqllogictests/suites/mode/cluster/memo/aggregate_property.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where t_10.a = t_1000.a and t_100.a = t_1000.a
2626
----
2727
Memo
2828
├── root group: #8
29-
├── estimated memory: 8.44 KiB
29+
├── estimated memory: 10.69 KiB
3030
├── Group #0
3131
│ ├── Best properties
3232
│ │ ├── { dist: Any }: expr: #0, cost: 1000.000, children: []

tests/sqllogictests/suites/mode/cluster/memo/join_property.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ select * from t_10, t_100, t_1000 where t_10.a = t_1000.a and t_100.a = t_1000.a
2525
----
2626
Memo
2727
├── root group: #5
28-
├── estimated memory: 6.56 KiB
28+
├── estimated memory: 8.31 KiB
2929
├── Group #0
3030
│ ├── Best properties
3131
│ │ ├── { dist: Any }: expr: #0, cost: 1000.000, children: []

tests/sqllogictests/suites/mode/cluster/memo/mix_property.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ limit 10
2929
----
3030
Memo
3131
├── root group: #10
32-
├── estimated memory: 22.03 KiB
32+
├── estimated memory: 27.91 KiB
3333
├── Group #0
3434
│ ├── Best properties
3535
│ │ ├── { dist: Any }: expr: #0, cost: 1000.000, children: []

0 commit comments

Comments
 (0)