Compare commits

..

1 Commits

Author SHA1 Message Date
Andrew Kane
28d4bf1f31 Removed dimensions check [skip ci] 2023-04-30 21:08:53 -07:00
4 changed files with 1 additions and 18 deletions

View File

@@ -312,10 +312,6 @@ Two things you can try are:
1. use dimensionality reduction
2. compile Postgres with a larger block size (`./configure --with-blocksize=32`) and edit the limit in `src/ivfflat.h`
#### Why am I seeing less results after adding an index?
The index was likely created with too little data for the number of lists. Drop the index until the table has more data.
## Reference
### Vector Type

View File

@@ -206,7 +206,6 @@ typedef struct IvfflatScanOpaqueData
/* Lists */
pairingheap *listQueue;
double minDistance;
IvfflatScanList lists[FLEXIBLE_ARRAY_MEMBER]; /* must come last */
} IvfflatScanOpaqueData;

View File

@@ -60,9 +60,6 @@ GetScanLists(IndexScanDesc scan, Datum value)
/* Use procinfo from the index instead of scan key for performance */
distance = DatumGetFloat8(FunctionCall2Coll(so->procinfo, so->collation, PointerGetDatum(&list->center), value));
if (distance < so->minDistance)
so->minDistance = distance;
if (listCount < so->probes)
{
scanlist = &so->lists[listCount];
@@ -132,13 +129,7 @@ GetScanItems(IndexScanDesc scan, Datum value)
/* Search closest probes lists */
while (!pairingheap_is_empty(so->listQueue))
{
IvfflatScanList *scanlist = (IvfflatScanList *) pairingheap_remove_first(so->listQueue);
/* Query-aware dynamic pruning */
if (fabs(scanlist->distance) > 1.5 * fabs(so->minDistance))
continue;
searchPage = scanlist->startPage;
searchPage = ((IvfflatScanList *) pairingheap_remove_first(so->listQueue))->startPage;
/* Search all entry pages for list */
while (BlockNumberIsValid(searchPage))
@@ -261,7 +252,6 @@ ivfflatrescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int
so->first = true;
pairingheap_reset(so->listQueue);
so->minDistance = DBL_MAX;
if (keys && scan->numberOfKeys > 0)
memmove(scan->keyData, keys, scan->numberOfKeys * sizeof(ScanKeyData));

View File

@@ -492,8 +492,6 @@ vector_l2_squared_distance(PG_FUNCTION_ARGS)
double distance = 0.0;
double diff;
CheckDims(a, b);
/* Auto-vectorized */
for (int i = 0; i < a->dim; i++)
{