bootcamp icon indicating copy to clipboard operation
bootcamp copied to clipboard

[Question] what happened if i only do create_index() on collection creation not everytime i insert to collection?

Open utopictown opened this issue 2 years ago • 3 comments

was wondering because usually in SQL we only create index once for table but in example quick deploy we create index everytime we insert data to collection

utopictown avatar Aug 11 '22 05:08 utopictown

@utopictown Hi, yes, you can call create_index() only once and Milvus will automatically build an index when the data size reaches the sealed segment size, which is determined by datacoord.segment.maxSize and datacoord.segment.sealProportion.

The difference is that if you manually call create_index after inserting data, Milvus will create an index for the remaining data. At this time, the amount of data does not need to reach the size of the sealed segment, but it is required to be higher than rootCoord.minSegmentSizeToEnableIndex.

I think all the data inserted into the system needs to be indexed, so create_index will be called after each data insertion. Of course, you can also use create Index once after creating the Milvus collection.

shiyu22 avatar Aug 11 '22 06:08 shiyu22

@shiyu22 thank you for the answer, i have problem in querying the vectors, it took too long and never succeed, does this has anyhting to do with the indexing?

utopictown avatar Aug 17 '22 10:08 utopictown

I think this is related to your data scale and hardware. You can run docker logs milvus-standalone to view the logs. If there are any error messages, you can submit an issue to the Milvus project.

BTW, you can first run Milvus on a small scale to check it.

shiyu22 avatar Aug 17 '22 11:08 shiyu22