mirror of https://github.com/milvus-io/milvus.git
test: adjust index timing (#31492)
index before insert Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>pull/31513/head
parent
09281a07f4
commit
be68b84088
|
@ -20,6 +20,20 @@ class TestE2e(TestcaseBase):
|
||||||
collection_w = self.init_collection_wrap(name=name, active_trace=True)
|
collection_w = self.init_collection_wrap(name=name, active_trace=True)
|
||||||
tt = time.time() - t0
|
tt = time.time() - t0
|
||||||
assert collection_w.name == name
|
assert collection_w.name == name
|
||||||
|
|
||||||
|
# index
|
||||||
|
index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"}
|
||||||
|
t0 = time.time()
|
||||||
|
index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name,
|
||||||
|
index_params=index_params,
|
||||||
|
index_name=cf.gen_unique_str())
|
||||||
|
index, _ = collection_w.create_index(field_name=ct.default_string_field_name,
|
||||||
|
index_params={},
|
||||||
|
index_name=cf.gen_unique_str())
|
||||||
|
tt = time.time() - t0
|
||||||
|
log.info(f"assert index: {tt}")
|
||||||
|
assert len(collection_w.indexes) == 2
|
||||||
|
|
||||||
entities = collection_w.num_entities
|
entities = collection_w.num_entities
|
||||||
log.info(f"assert create collection: {tt}, init_entities: {entities}")
|
log.info(f"assert create collection: {tt}, init_entities: {entities}")
|
||||||
|
|
||||||
|
@ -40,19 +54,6 @@ class TestE2e(TestcaseBase):
|
||||||
entities = collection_w.num_entities
|
entities = collection_w.num_entities
|
||||||
log.info(f"assert flush: {tt}, entities: {entities}")
|
log.info(f"assert flush: {tt}, entities: {entities}")
|
||||||
|
|
||||||
# index
|
|
||||||
index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"}
|
|
||||||
t0 = time.time()
|
|
||||||
index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name,
|
|
||||||
index_params=index_params,
|
|
||||||
index_name=cf.gen_unique_str())
|
|
||||||
index, _ = collection_w.create_index(field_name=ct.default_string_field_name,
|
|
||||||
index_params={},
|
|
||||||
index_name=cf.gen_unique_str())
|
|
||||||
tt = time.time() - t0
|
|
||||||
log.info(f"assert index: {tt}")
|
|
||||||
assert len(collection_w.indexes) == 2
|
|
||||||
|
|
||||||
# load
|
# load
|
||||||
collection_w.load()
|
collection_w.load()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue