pgvector.git / summary / log / commit / refs
commit 121baa411ea71fc411037b456f84e81d2dd26a10
Author: Andrew Kane <andrew@ankane.org>
Date: Sun Mar 26 19:45:44 2023 +0000
Added debug message for index scan
src/ivfscan.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/ivfscan.c b/src/ivfscan.c
index 85e7f082..ce530532 100644
--- a/src/ivfscan.c
+++ b/src/ivfscan.c
@@ -111,6 +111,7 @@ GetScanItems(IndexScanDesc scan, Datum value)
Datum datum;
bool isnull;
TupleDesc tupdesc = RelationGetDescr(scan->indexRelation);
+ double tuples = 0;
#if PG_VERSION_NUM >= 120000
TupleTableSlot *slot = MakeSingleTupleTableSlot(so->tupdesc, &TTSOpsVirtual);
@@ -159,6 +160,8 @@ GetScanItems(IndexScanDesc scan, Datum value)
ExecStoreVirtualTuple(slot);
tuplesort_puttupleslot(so->sortstate, slot);
+
+ tuples++;
}
searchPage = IvfflatPageGetOpaque(page)->nextblkno;
@@ -167,6 +170,13 @@ GetScanItems(IndexScanDesc scan, Datum value)
}
}
+ /* TODO Scan more lists */
+ if (tuples < 100)
+ ereport(DEBUG1,
+ (errmsg("index scan found few tuples"),
+ errdetail("index may have been created without data or lists is too high"),
+ errhint("recreate the index and possibly decrease lists")));
+
tuplesort_performsort(so->sortstate);
}
[parent: 50005d73260b]