mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +08:00
Added notice when index created with little data [skip ci]
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
## 0.4.2 (unreleased)
|
||||
|
||||
- Added notice when index created with little data
|
||||
|
||||
## 0.4.1 (2023-03-21)
|
||||
|
||||
- Improved performance of cosine distance
|
||||
|
||||
@@ -431,8 +431,18 @@ ComputeCenters(IvfflatBuildState * buildstate)
|
||||
/* TODO Ensure within maintenance_work_mem */
|
||||
buildstate->samples = VectorArrayInit(numSamples, buildstate->dimensions);
|
||||
if (buildstate->heap != NULL)
|
||||
{
|
||||
SampleRows(buildstate);
|
||||
|
||||
if (buildstate->samples->length < buildstate->lists)
|
||||
{
|
||||
ereport(NOTICE,
|
||||
(errmsg("index created with little data"),
|
||||
errdetail("this will cause poor recall"),
|
||||
errhint("drop the index until the table has more data")));
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate centers */
|
||||
IvfflatBench("k-means", IvfflatKmeans(buildstate->index, buildstate->samples, buildstate->centers));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user