mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-22 03:57:34 +08:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d458ad5d7 | ||
|
|
9fa17c10b8 | ||
|
|
14149b19f5 | ||
|
|
34d796fbab | ||
|
|
53341bb6c7 | ||
|
|
0d9720f440 | ||
|
|
cb246cb72d | ||
|
|
d053de2d94 | ||
|
|
83bac90869 | ||
|
|
4eca5024df | ||
|
|
a31771bc45 | ||
|
|
ecddde963a | ||
|
|
ecd413d0fe | ||
|
|
497db7976c | ||
|
|
f1dd4e3b03 | ||
|
|
7d067d7b83 | ||
|
|
d4dd73d970 | ||
|
|
ffe28bb954 | ||
|
|
0dbc1a27c0 | ||
|
|
08c4e7ff10 | ||
|
|
6731c49811 | ||
|
|
f2617f02d1 | ||
|
|
bdf19077db | ||
|
|
90cd2b4ee5 | ||
|
|
b44d1b4c5f | ||
|
|
cc5b865c33 | ||
|
|
4895021088 | ||
|
|
eda77b3492 | ||
|
|
a2364b1793 | ||
|
|
a0eaf70d17 |
@@ -1,3 +1,8 @@
|
|||||||
|
## 0.8.4 (2026-06-30)
|
||||||
|
|
||||||
|
- Fixed `hnsw graph not repaired` error with HNSW vacuuming
|
||||||
|
- Fixed possible error with inserts during HNSW vacuuming
|
||||||
|
|
||||||
## 0.8.3 (2026-06-17)
|
## 0.8.3 (2026-06-17)
|
||||||
|
|
||||||
- Fixed possible index corruption with HNSW vacuuming
|
- Fixed possible index corruption with HNSW vacuuming
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ARG DEBIAN_CODENAME=bookworm
|
|||||||
FROM postgres:$PG_MAJOR-$DEBIAN_CODENAME
|
FROM postgres:$PG_MAJOR-$DEBIAN_CODENAME
|
||||||
ARG PG_MAJOR
|
ARG PG_MAJOR
|
||||||
|
|
||||||
ADD https://github.com/pgvector/pgvector.git#v0.8.3 /tmp/pgvector
|
ADD https://github.com/pgvector/pgvector.git#v0.8.4 /tmp/pgvector
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-mark hold locales && \
|
apt-mark hold locales && \
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
"name": "vector",
|
"name": "vector",
|
||||||
"abstract": "Open-source vector similarity search for Postgres",
|
"abstract": "Open-source vector similarity search for Postgres",
|
||||||
"description": "Supports L2 distance, inner product, and cosine distance",
|
"description": "Supports L2 distance, inner product, and cosine distance",
|
||||||
"version": "0.8.3",
|
"version": "0.8.4",
|
||||||
"maintainer": [
|
"maintainer": [
|
||||||
"Andrew Kane <andrew@ankane.org>"
|
"Andrew Kane <andrew@ankane.org>"
|
||||||
],
|
],
|
||||||
"license": {
|
"license": {
|
||||||
"PostgreSQL": "http://www.postgresql.org/about/licence"
|
"PostgreSQL": "https://www.postgresql.org/about/licence"
|
||||||
},
|
},
|
||||||
"prereqs": {
|
"prereqs": {
|
||||||
"runtime": {
|
"runtime": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"vector": {
|
"vector": {
|
||||||
"file": "sql/vector.sql",
|
"file": "sql/vector.sql",
|
||||||
"docfile": "README.md",
|
"docfile": "README.md",
|
||||||
"version": "0.8.3",
|
"version": "0.8.4",
|
||||||
"abstract": "Open-source vector similarity search for Postgres"
|
"abstract": "Open-source vector similarity search for Postgres"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"generated_by": "Andrew Kane",
|
"generated_by": "Andrew Kane",
|
||||||
"meta-spec": {
|
"meta-spec": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"url": "http://pgxn.org/meta/spec.txt"
|
"url": "https://pgxn.org/meta/spec.txt"
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"vectors",
|
"vectors",
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
|||||||
EXTENSION = vector
|
EXTENSION = vector
|
||||||
EXTVERSION = 0.8.3
|
EXTVERSION = 0.8.4
|
||||||
|
|
||||||
MODULE_big = vector
|
MODULE_big = vector
|
||||||
DATA = $(wildcard sql/*--*--*.sql)
|
DATA = $(wildcard sql/*--*--*.sql)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
EXTENSION = vector
|
EXTENSION = vector
|
||||||
EXTVERSION = 0.8.3
|
EXTVERSION = 0.8.4
|
||||||
|
|
||||||
DATA_built = sql\$(EXTENSION)--$(EXTVERSION).sql
|
DATA_built = sql\$(EXTENSION)--$(EXTVERSION).sql
|
||||||
OBJS = src\bitutils.obj src\bitvec.obj src\halfutils.obj src\halfvec.obj src\hnsw.obj src\hnswbuild.obj src\hnswinsert.obj src\hnswscan.obj src\hnswutils.obj src\hnswvacuum.obj src\ivfbuild.obj src\ivfflat.obj src\ivfinsert.obj src\ivfkmeans.obj src\ivfscan.obj src\ivfutils.obj src\ivfvacuum.obj src\sparsevec.obj src\vector.obj
|
OBJS = src\bitutils.obj src\bitvec.obj src\halfutils.obj src\halfvec.obj src\hnsw.obj src\hnswbuild.obj src\hnswinsert.obj src\hnswscan.obj src\hnswutils.obj src\hnswvacuum.obj src\ivfbuild.obj src\ivfflat.obj src\ivfinsert.obj src\ivfkmeans.obj src\ivfscan.obj src\ivfutils.obj src\ivfvacuum.obj src\sparsevec.obj src\vector.obj
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -23,7 +23,7 @@ Compile and install the extension (supports Postgres 13+)
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd /tmp
|
cd /tmp
|
||||||
git clone --branch v0.8.3 https://github.com/pgvector/pgvector.git
|
git clone --branch v0.8.4 https://github.com/pgvector/pgvector.git
|
||||||
cd pgvector
|
cd pgvector
|
||||||
make
|
make
|
||||||
make install # may need sudo
|
make install # may need sudo
|
||||||
@@ -40,7 +40,7 @@ Ensure [C++ support in Visual Studio](https://learn.microsoft.com/en-us/cpp/buil
|
|||||||
```cmd
|
```cmd
|
||||||
set "PGROOT=C:\Program Files\PostgreSQL\18"
|
set "PGROOT=C:\Program Files\PostgreSQL\18"
|
||||||
cd %TEMP%
|
cd %TEMP%
|
||||||
git clone --branch v0.8.3 https://github.com/pgvector/pgvector.git
|
git clone --branch v0.8.4 https://github.com/pgvector/pgvector.git
|
||||||
cd pgvector
|
cd pgvector
|
||||||
nmake /F Makefile.win
|
nmake /F Makefile.win
|
||||||
nmake /F Makefile.win install
|
nmake /F Makefile.win install
|
||||||
@@ -1151,23 +1151,23 @@ This adds pgvector to the [Postgres image](https://hub.docker.com/_/postgres) (r
|
|||||||
|
|
||||||
Supported tags are:
|
Supported tags are:
|
||||||
|
|
||||||
- `pg18-trixie`, `0.8.3-pg18-trixie`
|
- `pg18-trixie`, `0.8.4-pg18-trixie`
|
||||||
- `pg18-bookworm`, `0.8.3-pg18-bookworm`, `pg18`, `0.8.3-pg18`
|
- `pg18-bookworm`, `0.8.4-pg18-bookworm`, `pg18`, `0.8.4-pg18`
|
||||||
- `pg17-trixie`, `0.8.3-pg17-trixie`
|
- `pg17-trixie`, `0.8.4-pg17-trixie`
|
||||||
- `pg17-bookworm`, `0.8.3-pg17-bookworm`, `pg17`, `0.8.3-pg17`
|
- `pg17-bookworm`, `0.8.4-pg17-bookworm`, `pg17`, `0.8.4-pg17`
|
||||||
- `pg16-trixie`, `0.8.3-pg16-trixie`
|
- `pg16-trixie`, `0.8.4-pg16-trixie`
|
||||||
- `pg16-bookworm`, `0.8.3-pg16-bookworm`, `pg16`, `0.8.3-pg16`
|
- `pg16-bookworm`, `0.8.4-pg16-bookworm`, `pg16`, `0.8.4-pg16`
|
||||||
- `pg15-trixie`, `0.8.3-pg15-trixie`
|
- `pg15-trixie`, `0.8.4-pg15-trixie`
|
||||||
- `pg15-bookworm`, `0.8.3-pg15-bookworm`, `pg15`, `0.8.3-pg15`
|
- `pg15-bookworm`, `0.8.4-pg15-bookworm`, `pg15`, `0.8.4-pg15`
|
||||||
- `pg14-trixie`, `0.8.3-pg14-trixie`
|
- `pg14-trixie`, `0.8.4-pg14-trixie`
|
||||||
- `pg14-bookworm`, `0.8.3-pg14-bookworm`, `pg14`, `0.8.3-pg14`
|
- `pg14-bookworm`, `0.8.4-pg14-bookworm`, `pg14`, `0.8.4-pg14`
|
||||||
- `pg13-trixie`, `0.8.3-pg13-trixie`
|
- `pg13-trixie`, `0.8.4-pg13-trixie`
|
||||||
- `pg13-bookworm`, `0.8.3-pg13-bookworm`, `pg13`, `0.8.3-pg13`
|
- `pg13-bookworm`, `0.8.4-pg13-bookworm`, `pg13`, `0.8.4-pg13`
|
||||||
|
|
||||||
You can also build the image manually:
|
You can also build the image manually:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone --branch v0.8.3 https://github.com/pgvector/pgvector.git
|
git clone --branch v0.8.4 https://github.com/pgvector/pgvector.git
|
||||||
cd pgvector
|
cd pgvector
|
||||||
docker build --pull --build-arg PG_MAJOR=18 -t myuser/pgvector .
|
docker build --pull --build-arg PG_MAJOR=18 -t myuser/pgvector .
|
||||||
```
|
```
|
||||||
|
|||||||
2
sql/vector--0.8.3--0.8.4.sql
Normal file
2
sql/vector--0.8.3--0.8.4.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION vector UPDATE TO '0.8.4'" to load this file. \quit
|
||||||
@@ -427,7 +427,7 @@ typedef struct HnswVacuumState
|
|||||||
HnswSupport support;
|
HnswSupport support;
|
||||||
|
|
||||||
/* Variables */
|
/* Variables */
|
||||||
struct tidhash_hash *deleted;
|
struct tidhash_hash *deleting;
|
||||||
BufferAccessStrategy bas;
|
BufferAccessStrategy bas;
|
||||||
HnswNeighborTuple ntup;
|
HnswNeighborTuple ntup;
|
||||||
HnswElementData highestPoint;
|
HnswElementData highestPoint;
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index
|
|||||||
/* Get support functions */
|
/* Get support functions */
|
||||||
HnswInitSupport(&buildstate->support, index);
|
HnswInitSupport(&buildstate->support, index);
|
||||||
|
|
||||||
InitGraph(&buildstate->graphData, NULL, (Size) maintenance_work_mem * 1024L);
|
InitGraph(&buildstate->graphData, NULL, maintenance_work_mem * (Size) 1024);
|
||||||
buildstate->graph = &buildstate->graphData;
|
buildstate->graph = &buildstate->graphData;
|
||||||
buildstate->ml = HnswGetMl(buildstate->m);
|
buildstate->ml = HnswGetMl(buildstate->m);
|
||||||
buildstate->maxLevel = HnswGetMaxLevel(buildstate->m);
|
buildstate->maxLevel = HnswGetMaxLevel(buildstate->m);
|
||||||
@@ -956,7 +956,7 @@ HnswBeginParallel(HnswBuildState * buildstate, bool isconcurrent, int request)
|
|||||||
/* Leave space for other objects in shared memory */
|
/* Leave space for other objects in shared memory */
|
||||||
/* Docker has a default limit of 64 MB for shm_size */
|
/* Docker has a default limit of 64 MB for shm_size */
|
||||||
/* which happens to be the default value of maintenance_work_mem */
|
/* which happens to be the default value of maintenance_work_mem */
|
||||||
esthnswarea = maintenance_work_mem * 1024L;
|
esthnswarea = maintenance_work_mem * (Size) 1024;
|
||||||
estother = 3 * 1024 * 1024;
|
estother = 3 * 1024 * 1024;
|
||||||
if (esthnswarea > estother)
|
if (esthnswarea > estother)
|
||||||
esthnswarea -= estother;
|
esthnswarea -= estother;
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if deleted list contains an index TID
|
* Check if deletion list contains an element
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
DeletedContains(tidhash_hash * deleted, ItemPointer indextid)
|
DeletingElement(tidhash_hash * deleting, ItemPointer indextid)
|
||||||
{
|
{
|
||||||
return tidhash_lookup(deleted, *indextid) != NULL;
|
return tidhash_lookup(deleting, *indextid) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -80,6 +80,14 @@ RemoveHeapTids(HnswVacuumState * vacuumstate)
|
|||||||
if (!HnswIsElementTuple(etup))
|
if (!HnswIsElementTuple(etup))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Skip deleted tuples. It is important they are not added to the
|
||||||
|
* deletion list to avoid false positives in NeedsUpdated and
|
||||||
|
* ConfirmRepaired.
|
||||||
|
*/
|
||||||
|
if (etup->deleted)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ItemPointerIsValid(&etup->heaptids[0]))
|
if (ItemPointerIsValid(&etup->heaptids[0]))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < HNSW_HEAPTIDS; i++)
|
for (int i = 0; i < HNSW_HEAPTIDS; i++)
|
||||||
@@ -113,13 +121,13 @@ RemoveHeapTids(HnswVacuumState * vacuumstate)
|
|||||||
|
|
||||||
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
||||||
{
|
{
|
||||||
ItemPointerData ip;
|
ItemPointerData indextid;
|
||||||
bool found;
|
bool found;
|
||||||
|
|
||||||
/* Add to deleted list */
|
/* Add to deletion list */
|
||||||
ItemPointerSet(&ip, blkno, offno);
|
ItemPointerSet(&indextid, blkno, offno);
|
||||||
|
|
||||||
tidhash_insert(vacuumstate->deleted, ip, &found);
|
tidhash_insert(vacuumstate->deleting, indextid, &found);
|
||||||
Assert(!found);
|
Assert(!found);
|
||||||
}
|
}
|
||||||
else if (etup->level > highestLevel)
|
else if (etup->level > highestLevel)
|
||||||
@@ -192,8 +200,8 @@ NeedsUpdated(HnswVacuumState * vacuumstate, HnswElement element)
|
|||||||
if (!ItemPointerIsValid(indextid))
|
if (!ItemPointerIsValid(indextid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Check if in deleted list */
|
/* Check if in deletion list */
|
||||||
if (DeletedContains(vacuumstate->deleted, indextid))
|
if (DeletingElement(vacuumstate->deleting, indextid))
|
||||||
{
|
{
|
||||||
needsUpdated = true;
|
needsUpdated = true;
|
||||||
break;
|
break;
|
||||||
@@ -202,13 +210,9 @@ NeedsUpdated(HnswVacuumState * vacuumstate, HnswElement element)
|
|||||||
|
|
||||||
/* Also update if layer 0 is not full */
|
/* Also update if layer 0 is not full */
|
||||||
/* This could indicate too many candidates being deleted during insert */
|
/* This could indicate too many candidates being deleted during insert */
|
||||||
if (!needsUpdated)
|
/* There should always be more than zero indextids, but check for safety */
|
||||||
{
|
if (!needsUpdated && ntup->count > 0)
|
||||||
/* Keep clang-tidy happy */
|
|
||||||
Assert(ntup->count > 0);
|
|
||||||
|
|
||||||
needsUpdated = !ItemPointerIsValid(&ntup->indextids[ntup->count - 1]);
|
needsUpdated = !ItemPointerIsValid(&ntup->indextids[ntup->count - 1]);
|
||||||
}
|
|
||||||
|
|
||||||
UnlockReleaseBuffer(buf);
|
UnlockReleaseBuffer(buf);
|
||||||
|
|
||||||
@@ -331,7 +335,7 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
|
|||||||
|
|
||||||
ItemPointerSet(&epData, entryPoint->blkno, entryPoint->offno);
|
ItemPointerSet(&epData, entryPoint->blkno, entryPoint->offno);
|
||||||
|
|
||||||
if (DeletedContains(vacuumstate->deleted, &epData))
|
if (DeletingElement(vacuumstate->deleting, &epData))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Replace the entry point with the highest point. If highest
|
* Replace the entry point with the highest point. If highest
|
||||||
@@ -417,6 +421,10 @@ RepairGraph(HnswVacuumState * vacuumstate)
|
|||||||
if (!HnswIsElementTuple(etup))
|
if (!HnswIsElementTuple(etup))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Skip deleted tuples */
|
||||||
|
if (etup->deleted)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Skip updating neighbors if being deleted */
|
/* Skip updating neighbors if being deleted */
|
||||||
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
||||||
continue;
|
continue;
|
||||||
@@ -531,6 +539,10 @@ ConfirmRepaired(HnswVacuumState * vacuumstate)
|
|||||||
if (!HnswIsElementTuple(etup))
|
if (!HnswIsElementTuple(etup))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Skip deleted tuples */
|
||||||
|
if (etup->deleted)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Skip if being deleted */
|
/* Skip if being deleted */
|
||||||
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
if (!ItemPointerIsValid(&etup->heaptids[0]))
|
||||||
continue;
|
continue;
|
||||||
@@ -561,8 +573,8 @@ ConfirmRepaired(HnswVacuumState * vacuumstate)
|
|||||||
if (!ItemPointerIsValid(indextid))
|
if (!ItemPointerIsValid(indextid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Check if in deleted list */
|
/* Check if in deletion list */
|
||||||
if (DeletedContains(vacuumstate->deleted, indextid))
|
if (DeletingElement(vacuumstate->deleting, indextid))
|
||||||
elog(ERROR, "hnsw graph not repaired");
|
elog(ERROR, "hnsw graph not repaired");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,10 +600,15 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
|||||||
BufferAccessStrategy bas = vacuumstate->bas;
|
BufferAccessStrategy bas = vacuumstate->bas;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait for index scans to complete. Scans before this point may contain
|
* Wait for inserts and index scans to complete. Inserts and scans before
|
||||||
* tuples about to be deleted. Scans after this point will not, since the
|
* this point may visit tuples about to be deleted. Inserts and scans
|
||||||
* graph has been repaired.
|
* after this point will not, since the graph has been repaired.
|
||||||
*/
|
*/
|
||||||
|
LockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
|
||||||
|
UnlockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
|
||||||
|
|
||||||
|
ConfirmRepaired(vacuumstate);
|
||||||
|
|
||||||
LockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
LockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
||||||
UnlockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
UnlockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
||||||
|
|
||||||
@@ -739,7 +756,7 @@ InitVacuumState(HnswVacuumState * vacuumstate, IndexVacuumInfo *info, IndexBulkD
|
|||||||
HnswGetMetaPageInfo(index, &vacuumstate->m, NULL);
|
HnswGetMetaPageInfo(index, &vacuumstate->m, NULL);
|
||||||
|
|
||||||
/* Create hash table */
|
/* Create hash table */
|
||||||
vacuumstate->deleted = tidhash_create(CurrentMemoryContext, 256, NULL);
|
vacuumstate->deleting = tidhash_create(CurrentMemoryContext, 256, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -748,7 +765,7 @@ InitVacuumState(HnswVacuumState * vacuumstate, IndexVacuumInfo *info, IndexBulkD
|
|||||||
static void
|
static void
|
||||||
FreeVacuumState(HnswVacuumState * vacuumstate)
|
FreeVacuumState(HnswVacuumState * vacuumstate)
|
||||||
{
|
{
|
||||||
tidhash_destroy(vacuumstate->deleted);
|
tidhash_destroy(vacuumstate->deleting);
|
||||||
FreeAccessStrategy(vacuumstate->bas);
|
FreeAccessStrategy(vacuumstate->bas);
|
||||||
pfree(vacuumstate->ntup);
|
pfree(vacuumstate->ntup);
|
||||||
MemoryContextDelete(vacuumstate->tmpCtx);
|
MemoryContextDelete(vacuumstate->tmpCtx);
|
||||||
@@ -771,10 +788,7 @@ hnswbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
|
|||||||
/* Pass 2: Repair graph */
|
/* Pass 2: Repair graph */
|
||||||
HnswBench("RepairGraph", RepairGraph(&vacuumstate));
|
HnswBench("RepairGraph", RepairGraph(&vacuumstate));
|
||||||
|
|
||||||
/* Pass 3: Confirm repaired */
|
/* Passes 3 and 4: Confirm repaired and mark as deleted */
|
||||||
HnswBench("ConfirmRepaired", ConfirmRepaired(&vacuumstate));
|
|
||||||
|
|
||||||
/* Pass 4: Mark as deleted */
|
|
||||||
HnswBench("MarkDeleted", MarkDeleted(&vacuumstate));
|
HnswBench("MarkDeleted", MarkDeleted(&vacuumstate));
|
||||||
|
|
||||||
FreeVacuumState(&vacuumstate);
|
FreeVacuumState(&vacuumstate);
|
||||||
|
|||||||
@@ -152,18 +152,7 @@ SampleRows(IvfflatBuildState * buildstate)
|
|||||||
|
|
||||||
/* Normalize if needed */
|
/* Normalize if needed */
|
||||||
if (buildstate->kmeansnormprocinfo != NULL)
|
if (buildstate->kmeansnormprocinfo != NULL)
|
||||||
{
|
IvfflatNormVectors(buildstate->typeInfo, buildstate->collation, buildstate->samples, buildstate->tmpCtx);
|
||||||
VectorArray samples = buildstate->samples;
|
|
||||||
|
|
||||||
for (int i = 0; i < samples->length; i++)
|
|
||||||
{
|
|
||||||
Datum value = PointerGetDatum(VectorArrayGet(samples, i));
|
|
||||||
Datum normValue = IvfflatNormValue(buildstate->typeInfo, buildstate->collation, value);
|
|
||||||
|
|
||||||
VectorArraySet(samples, i, DatumGetPointer(normValue));
|
|
||||||
pfree(DatumGetPointer(normValue));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -399,8 +388,14 @@ InitBuildState(IvfflatBuildState * buildstate, Relation heap, Relation index, In
|
|||||||
|
|
||||||
buildstate->slot = MakeSingleTupleTableSlot(buildstate->sortdesc, &TTSOpsVirtual);
|
buildstate->slot = MakeSingleTupleTableSlot(buildstate->sortdesc, &TTSOpsVirtual);
|
||||||
|
|
||||||
/* TODO Ensure within maintenance_work_mem */
|
buildstate->memoryUsed = 0;
|
||||||
buildstate->centers = VectorArrayInit(buildstate->lists, buildstate->dimensions, buildstate->typeInfo->itemSize(buildstate->dimensions));
|
buildstate->itemsize = buildstate->typeInfo->itemSize(buildstate->dimensions);
|
||||||
|
|
||||||
|
buildstate->memoryUsed += VECTOR_ARRAY_SIZE(buildstate->lists, buildstate->itemsize);
|
||||||
|
IvfflatCheckMemoryUsage(buildstate->memoryUsed);
|
||||||
|
buildstate->centers = VectorArrayInit(buildstate->lists, buildstate->dimensions, buildstate->itemsize);
|
||||||
|
|
||||||
|
/* TODO Move allocation to page creation */
|
||||||
buildstate->listInfo = palloc(sizeof(ListInfo) * buildstate->lists);
|
buildstate->listInfo = palloc(sizeof(ListInfo) * buildstate->lists);
|
||||||
|
|
||||||
buildstate->tmpCtx = AllocSetContextCreate(CurrentMemoryContext,
|
buildstate->tmpCtx = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
@@ -454,8 +449,9 @@ ComputeCenters(IvfflatBuildState * buildstate)
|
|||||||
numSamples = 1;
|
numSamples = 1;
|
||||||
|
|
||||||
/* Sample rows */
|
/* Sample rows */
|
||||||
/* TODO Ensure within maintenance_work_mem */
|
buildstate->memoryUsed += VECTOR_ARRAY_SIZE(numSamples, buildstate->itemsize);
|
||||||
buildstate->samples = VectorArrayInit(numSamples, buildstate->dimensions, buildstate->centers->itemsize);
|
IvfflatCheckMemoryUsage(buildstate->memoryUsed);
|
||||||
|
buildstate->samples = VectorArrayInit(numSamples, buildstate->dimensions, buildstate->itemsize);
|
||||||
if (buildstate->heap != NULL)
|
if (buildstate->heap != NULL)
|
||||||
{
|
{
|
||||||
IvfflatBench("sample rows", SampleRows(buildstate));
|
IvfflatBench("sample rows", SampleRows(buildstate));
|
||||||
@@ -470,7 +466,7 @@ ComputeCenters(IvfflatBuildState * buildstate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate centers */
|
/* Calculate centers */
|
||||||
IvfflatBench("k-means", IvfflatKmeans(buildstate->index, buildstate->samples, buildstate->centers, buildstate->typeInfo));
|
IvfflatBench("k-means", IvfflatKmeans(buildstate->index, buildstate->samples, buildstate->centers, buildstate->typeInfo, buildstate->memoryUsed));
|
||||||
|
|
||||||
/* Free samples before we allocate more memory */
|
/* Free samples before we allocate more memory */
|
||||||
VectorArrayFree(buildstate->samples);
|
VectorArrayFree(buildstate->samples);
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ typedef struct IvfflatBuildState
|
|||||||
VectorArray samples;
|
VectorArray samples;
|
||||||
VectorArray centers;
|
VectorArray centers;
|
||||||
ListInfo *listInfo;
|
ListInfo *listInfo;
|
||||||
|
Size itemsize;
|
||||||
|
|
||||||
#ifdef IVFFLAT_KMEANS_DEBUG
|
#ifdef IVFFLAT_KMEANS_DEBUG
|
||||||
double inertia;
|
double inertia;
|
||||||
@@ -223,6 +224,7 @@ typedef struct IvfflatBuildState
|
|||||||
TupleTableSlot *slot;
|
TupleTableSlot *slot;
|
||||||
|
|
||||||
/* Memory */
|
/* Memory */
|
||||||
|
Size memoryUsed;
|
||||||
MemoryContext tmpCtx;
|
MemoryContext tmpCtx;
|
||||||
|
|
||||||
/* Parallel builds */
|
/* Parallel builds */
|
||||||
@@ -303,22 +305,32 @@ typedef IvfflatScanOpaqueData * IvfflatScanOpaque;
|
|||||||
static inline Pointer
|
static inline Pointer
|
||||||
VectorArrayGet(VectorArray arr, int offset)
|
VectorArrayGet(VectorArray arr, int offset)
|
||||||
{
|
{
|
||||||
|
if (offset >= arr->maxlen)
|
||||||
|
elog(ERROR, "safety check failed");
|
||||||
|
|
||||||
return ((char *) arr->items) + (offset * arr->itemsize);
|
return ((char *) arr->items) + (offset * arr->itemsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
VectorArraySet(VectorArray arr, int offset, Pointer val)
|
VectorArraySet(VectorArray arr, int offset, Pointer val)
|
||||||
{
|
{
|
||||||
memcpy(VectorArrayGet(arr, offset), val, VARSIZE_ANY(val));
|
Size size = VARSIZE_ANY(val);
|
||||||
|
|
||||||
|
if (size > arr->itemsize)
|
||||||
|
elog(ERROR, "safety check failed");
|
||||||
|
|
||||||
|
memcpy(VectorArrayGet(arr, offset), val, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Methods */
|
/* Methods */
|
||||||
VectorArray VectorArrayInit(int maxlen, int dimensions, Size itemsize);
|
VectorArray VectorArrayInit(int maxlen, int dimensions, Size itemsize);
|
||||||
void VectorArrayFree(VectorArray arr);
|
void VectorArrayFree(VectorArray arr);
|
||||||
void IvfflatKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo);
|
void IvfflatKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo, Size memoryUsed);
|
||||||
FmgrInfo *IvfflatOptionalProcInfo(Relation index, uint16 procnum);
|
FmgrInfo *IvfflatOptionalProcInfo(Relation index, uint16 procnum);
|
||||||
Datum IvfflatNormValue(const IvfflatTypeInfo * typeInfo, Oid collation, Datum value);
|
Datum IvfflatNormValue(const IvfflatTypeInfo * typeInfo, Oid collation, Datum value);
|
||||||
bool IvfflatCheckNorm(FmgrInfo *procinfo, Oid collation, Datum value);
|
bool IvfflatCheckNorm(FmgrInfo *procinfo, Oid collation, Datum value);
|
||||||
|
void IvfflatNormVectors(const IvfflatTypeInfo * typeInfo, Oid collation, VectorArray arr, MemoryContext tmpCtx);
|
||||||
|
void IvfflatCheckMemoryUsage(Size totalSize);
|
||||||
int IvfflatGetLists(Relation index);
|
int IvfflatGetLists(Relation index);
|
||||||
void IvfflatGetMetaPageInfo(Relation index, int *lists, int *dimensions);
|
void IvfflatGetMetaPageInfo(Relation index, int *lists, int *dimensions);
|
||||||
void IvfflatUpdateList(Relation index, ListInfo listInfo, BlockNumber insertPage, BlockNumber originalInsertPage, BlockNumber startPage, ForkNumber forkNum);
|
void IvfflatUpdateList(Relation index, ListInfo listInfo, BlockNumber insertPage, BlockNumber originalInsertPage, BlockNumber startPage, ForkNumber forkNum);
|
||||||
|
|||||||
@@ -99,22 +99,8 @@ NormCenters(const IvfflatTypeInfo * typeInfo, Oid collation, VectorArray centers
|
|||||||
MemoryContext normCtx = AllocSetContextCreate(CurrentMemoryContext,
|
MemoryContext normCtx = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
"Ivfflat norm temporary context",
|
"Ivfflat norm temporary context",
|
||||||
ALLOCSET_DEFAULT_SIZES);
|
ALLOCSET_DEFAULT_SIZES);
|
||||||
MemoryContext oldCtx = MemoryContextSwitchTo(normCtx);
|
|
||||||
|
|
||||||
for (int j = 0; j < centers->length; j++)
|
IvfflatNormVectors(typeInfo, collation, centers, normCtx);
|
||||||
{
|
|
||||||
Datum center = PointerGetDatum(VectorArrayGet(centers, j));
|
|
||||||
Datum newCenter = IvfflatNormValue(typeInfo, collation, center);
|
|
||||||
Size size = VARSIZE_ANY(DatumGetPointer(newCenter));
|
|
||||||
|
|
||||||
if (size > centers->itemsize)
|
|
||||||
elog(ERROR, "safety check failed");
|
|
||||||
|
|
||||||
memcpy(DatumGetPointer(center), DatumGetPointer(newCenter), size);
|
|
||||||
MemoryContextReset(normCtx);
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldCtx);
|
|
||||||
MemoryContextDelete(normCtx);
|
MemoryContextDelete(normCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +244,7 @@ ComputeNewCenters(VectorArray samples, float *agg, VectorArray newCenters, int *
|
|||||||
* https://www.aaai.org/Papers/ICML/2003/ICML03-022.pdf
|
* https://www.aaai.org/Papers/ICML/2003/ICML03-022.pdf
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo)
|
ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo, Size memoryUsed)
|
||||||
{
|
{
|
||||||
FmgrInfo *procinfo;
|
FmgrInfo *procinfo;
|
||||||
FmgrInfo *normprocinfo;
|
FmgrInfo *normprocinfo;
|
||||||
@@ -277,8 +263,6 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const Ivff
|
|||||||
float *newcdist;
|
float *newcdist;
|
||||||
|
|
||||||
/* Calculate allocation sizes */
|
/* Calculate allocation sizes */
|
||||||
Size samplesSize = VECTOR_ARRAY_SIZE(samples->maxlen, samples->itemsize);
|
|
||||||
Size centersSize = VECTOR_ARRAY_SIZE(centers->maxlen, centers->itemsize);
|
|
||||||
Size newCentersSize = VECTOR_ARRAY_SIZE(numCenters, centers->itemsize);
|
Size newCentersSize = VECTOR_ARRAY_SIZE(numCenters, centers->itemsize);
|
||||||
Size aggSize = sizeof(float) * (int64) numCenters * dimensions;
|
Size aggSize = sizeof(float) * (int64) numCenters * dimensions;
|
||||||
Size centerCountsSize = sizeof(int) * numCenters;
|
Size centerCountsSize = sizeof(int) * numCenters;
|
||||||
@@ -290,18 +274,13 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const Ivff
|
|||||||
Size newcdistSize = sizeof(float) * numCenters;
|
Size newcdistSize = sizeof(float) * numCenters;
|
||||||
|
|
||||||
/* Calculate total size */
|
/* Calculate total size */
|
||||||
Size totalSize = samplesSize + centersSize + newCentersSize + aggSize + centerCountsSize + closestCentersSize + lowerBoundSize + upperBoundSize + sSize + halfcdistSize + newcdistSize;
|
Size totalSize = memoryUsed + newCentersSize + aggSize + centerCountsSize + closestCentersSize + lowerBoundSize + upperBoundSize + sSize + halfcdistSize + newcdistSize;
|
||||||
|
|
||||||
/* Check memory requirements */
|
/* Check memory requirements */
|
||||||
/* Add one to error message to ceil */
|
IvfflatCheckMemoryUsage(totalSize);
|
||||||
if (totalSize > (Size) maintenance_work_mem * 1024L)
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
|
||||||
errmsg("memory required is %zu MB, maintenance_work_mem is %d MB",
|
|
||||||
totalSize / (1024 * 1024) + 1, maintenance_work_mem / 1024)));
|
|
||||||
|
|
||||||
/* Ensure indexing does not overflow */
|
/* Ensure indexing does not overflow */
|
||||||
if (numCenters * numCenters > INT_MAX)
|
if (numCenters > INT_MAX / numCenters)
|
||||||
elog(ERROR, "Indexing overflow detected. Please report a bug.");
|
elog(ERROR, "Indexing overflow detected. Please report a bug.");
|
||||||
|
|
||||||
/* Set support functions */
|
/* Set support functions */
|
||||||
@@ -562,7 +541,7 @@ CheckCenters(Relation index, VectorArray centers, const IvfflatTypeInfo * typeIn
|
|||||||
* We use spherical k-means for inner product and cosine
|
* We use spherical k-means for inner product and cosine
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IvfflatKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo)
|
IvfflatKmeans(Relation index, VectorArray samples, VectorArray centers, const IvfflatTypeInfo * typeInfo, Size memoryUsed)
|
||||||
{
|
{
|
||||||
MemoryContext kmeansCtx = AllocSetContextCreate(CurrentMemoryContext,
|
MemoryContext kmeansCtx = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
"Ivfflat kmeans temporary context",
|
"Ivfflat kmeans temporary context",
|
||||||
@@ -572,7 +551,7 @@ IvfflatKmeans(Relation index, VectorArray samples, VectorArray centers, const Iv
|
|||||||
if (samples->length == 0)
|
if (samples->length == 0)
|
||||||
RandomCenters(index, centers, typeInfo);
|
RandomCenters(index, centers, typeInfo);
|
||||||
else
|
else
|
||||||
ElkanKmeans(index, samples, centers, typeInfo);
|
ElkanKmeans(index, samples, centers, typeInfo, memoryUsed);
|
||||||
|
|
||||||
CheckCenters(index, centers, typeInfo);
|
CheckCenters(index, centers, typeInfo);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
#include "halfutils.h"
|
#include "halfutils.h"
|
||||||
#include "halfvec.h"
|
#include "halfvec.h"
|
||||||
#include "ivfflat.h"
|
#include "ivfflat.h"
|
||||||
|
#include "miscadmin.h"
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
|
#include "utils/memutils.h"
|
||||||
#include "utils/relcache.h"
|
#include "utils/relcache.h"
|
||||||
#include "utils/varbit.h"
|
#include "utils/varbit.h"
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
@@ -88,6 +90,40 @@ IvfflatCheckNorm(FmgrInfo *procinfo, Oid collation, Datum value)
|
|||||||
return DatumGetFloat8(FunctionCall1Coll(procinfo, collation, value)) > 0;
|
return DatumGetFloat8(FunctionCall1Coll(procinfo, collation, value)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Normalize vectors
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
IvfflatNormVectors(const IvfflatTypeInfo * typeInfo, Oid collation, VectorArray arr, MemoryContext tmpCtx)
|
||||||
|
{
|
||||||
|
MemoryContext oldCtx = MemoryContextSwitchTo(tmpCtx);
|
||||||
|
|
||||||
|
for (int i = 0; i < arr->length; i++)
|
||||||
|
{
|
||||||
|
Datum value = PointerGetDatum(VectorArrayGet(arr, i));
|
||||||
|
Datum newValue = IvfflatNormValue(typeInfo, collation, value);
|
||||||
|
|
||||||
|
VectorArraySet(arr, i, DatumGetPointer(newValue));
|
||||||
|
MemoryContextReset(tmpCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
MemoryContextSwitchTo(oldCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check memory usage
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
IvfflatCheckMemoryUsage(Size totalSize)
|
||||||
|
{
|
||||||
|
/* Add one to error message to ceil */
|
||||||
|
if (totalSize > maintenance_work_mem * (Size) 1024)
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||||
|
errmsg("memory required is %zu MB, maintenance_work_mem is %d MB",
|
||||||
|
totalSize / (1024 * 1024) + 1, maintenance_work_mem / 1024)));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* New buffer
|
* New buffer
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PG_VERSION_NUM >= 180000
|
#if PG_VERSION_NUM >= 180000
|
||||||
PG_MODULE_MAGIC_EXT(.name = "vector", .version = "0.8.3");
|
PG_MODULE_MAGIC_EXT(.name = "vector", .version = "0.8.4");
|
||||||
#else
|
#else
|
||||||
PG_MODULE_MAGIC;
|
PG_MODULE_MAGIC;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
38
test/t/046_hnsw_vacuum_scan.pl
Normal file
38
test/t/046_hnsw_vacuum_scan.pl
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings FATAL => 'all';
|
||||||
|
use PostgreSQL::Test::Cluster;
|
||||||
|
use PostgreSQL::Test::Utils;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
|
my $dim = 3;
|
||||||
|
my $array_sql = join(",", ('random()') x $dim);
|
||||||
|
|
||||||
|
# Initialize node
|
||||||
|
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||||
|
$node->init;
|
||||||
|
$node->start;
|
||||||
|
|
||||||
|
# Create table and index
|
||||||
|
$node->safe_psql("postgres", "CREATE EXTENSION vector;");
|
||||||
|
$node->safe_psql("postgres", "CREATE TABLE tst (i serial, v vector($dim));");
|
||||||
|
$node->safe_psql("postgres", "ALTER TABLE tst SET (autovacuum_enabled = false);");
|
||||||
|
$node->safe_psql("postgres",
|
||||||
|
"INSERT INTO tst (v) SELECT ARRAY[$array_sql] FROM generate_series(1, 1000) i;"
|
||||||
|
);
|
||||||
|
$node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v vector_l2_ops);");
|
||||||
|
$node->safe_psql("postgres", "DELETE FROM tst");
|
||||||
|
|
||||||
|
# Test HNSW_SCAN_LOCK at the beginning of MarkDeleted is effective
|
||||||
|
$node->pgbench(
|
||||||
|
"--no-vacuum --client=5 --transactions=1000",
|
||||||
|
0,
|
||||||
|
[qr{actually processed}],
|
||||||
|
[qr{^$}],
|
||||||
|
"concurrent SELECTs and VACUUM",
|
||||||
|
{
|
||||||
|
"046_hnsw_vacuum_scan_select\@1000" => "SELECT i FROM tst ORDER BY v <-> '[0,0,0]' LIMIT 10;",
|
||||||
|
"046_hnsw_vacuum_scan_vacuum\@1" => "VACUUM tst;"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
done_testing();
|
||||||
39
test/t/047_hnsw_vacuum_insert.pl
Normal file
39
test/t/047_hnsw_vacuum_insert.pl
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
use strict;
|
||||||
|
use warnings FATAL => 'all';
|
||||||
|
use PostgreSQL::Test::Cluster;
|
||||||
|
use PostgreSQL::Test::Utils;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
|
my $dim = 3;
|
||||||
|
my $array_sql = join(",", ('random()') x $dim);
|
||||||
|
|
||||||
|
# Initialize node
|
||||||
|
my $node = PostgreSQL::Test::Cluster->new('node');
|
||||||
|
$node->init;
|
||||||
|
$node->start;
|
||||||
|
|
||||||
|
# Create table and index
|
||||||
|
$node->safe_psql("postgres", "CREATE EXTENSION vector;");
|
||||||
|
$node->safe_psql("postgres", "CREATE TABLE tst (i serial, v vector($dim));");
|
||||||
|
$node->safe_psql("postgres", "ALTER TABLE tst SET (autovacuum_enabled = false);");
|
||||||
|
$node->safe_psql("postgres",
|
||||||
|
"INSERT INTO tst (v) SELECT ARRAY[$array_sql] FROM generate_series(1, 1000) i;"
|
||||||
|
);
|
||||||
|
$node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v vector_l2_ops);");
|
||||||
|
|
||||||
|
# Test no "hnsw graph not repaired" errors
|
||||||
|
$node->pgbench(
|
||||||
|
"--no-vacuum --client=5 --transactions=1000",
|
||||||
|
0,
|
||||||
|
[qr{actually processed}],
|
||||||
|
[qr{^$}],
|
||||||
|
"concurrent INSERTs, DELETEs, SELECTs, and VACUUM",
|
||||||
|
{
|
||||||
|
"047_hnsw_vacuum_insert_insert\@500" => "INSERT INTO tst (v) VALUES (ARRAY[$array_sql]);",
|
||||||
|
"047_hnsw_vacuum_insert_delete\@500" => "DELETE FROM tst WHERE i = (SELECT i FROM tst LIMIT 1);",
|
||||||
|
"047_hnsw_vacuum_insert_select\@20" => "SELECT i FROM tst ORDER BY v <-> '[0,0,0]' LIMIT 10;",
|
||||||
|
"047_hnsw_vacuum_insert_vacuum\@1" => "VACUUM tst;"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
done_testing();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
comment = 'vector data type and ivfflat and hnsw access methods'
|
comment = 'vector data type and ivfflat and hnsw access methods'
|
||||||
default_version = '0.8.3'
|
default_version = '0.8.4'
|
||||||
module_pathname = '$libdir/vector'
|
module_pathname = '$libdir/vector'
|
||||||
relocatable = true
|
relocatable = true
|
||||||
|
|||||||
Reference in New Issue
Block a user