mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-22 03:57:34 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7f712b5a4 | ||
|
|
a532d82bda | ||
|
|
ccec96ba54 | ||
|
|
b7c5849ba7 | ||
|
|
135147893a | ||
|
|
00391953dd | ||
|
|
81bba1f37e |
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -16,8 +16,9 @@ jobs:
|
||||
- uses: ankane/setup-postgres@v1
|
||||
with:
|
||||
postgres-version: ${{ matrix.postgres }}
|
||||
dev-files: true
|
||||
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
||||
run: sudo apt-get update && sudo apt-get install postgresql-server-dev-${{ matrix.postgres }} libipc-run-perl
|
||||
run: sudo apt-get update && sudo apt-get install libipc-run-perl
|
||||
- run: make
|
||||
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
||||
run: |
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
## 0.3.2 (2022-11-22)
|
||||
|
||||
- Fixed `invalid memory alloc request size` error
|
||||
|
||||
## 0.3.1 (2022-11-02)
|
||||
|
||||
If upgrading from 0.2.7 or 0.3.0, [recreate](https://github.com/pgvector/pgvector#031) all `ivfflat` indexes after upgrading to ensure all data is indexed.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "vector",
|
||||
"abstract": "Open-source vector similarity search for Postgres",
|
||||
"description": "Supports L2 distance, inner product, and cosine distance",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"maintainer": [
|
||||
"Andrew Kane <andrew@ankane.org>"
|
||||
],
|
||||
@@ -20,7 +20,7 @@
|
||||
"vector": {
|
||||
"file": "sql/vector.sql",
|
||||
"docfile": "README.md",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"abstract": "Open-source vector similarity search for Postgres"
|
||||
}
|
||||
},
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
||||
EXTENSION = vector
|
||||
EXTVERSION = 0.3.1
|
||||
EXTVERSION = 0.3.2
|
||||
|
||||
MODULE_big = vector
|
||||
DATA = $(wildcard sql/*--*.sql)
|
||||
|
||||
@@ -17,7 +17,7 @@ Supports L2 distance, inner product, and cosine distance
|
||||
Compile and install the extension (supports Postgres 10+)
|
||||
|
||||
```sh
|
||||
git clone --branch v0.3.1 https://github.com/pgvector/pgvector.git
|
||||
git clone --branch v0.3.2 https://github.com/pgvector/pgvector.git
|
||||
cd pgvector
|
||||
make
|
||||
make install # may need sudo
|
||||
@@ -232,7 +232,7 @@ This adds pgvector to the [Postgres image](https://hub.docker.com/_/postgres).
|
||||
You can also build the image manually
|
||||
|
||||
```sh
|
||||
git clone --branch v0.3.1 https://github.com/pgvector/pgvector.git
|
||||
git clone --branch v0.3.2 https://github.com/pgvector/pgvector.git
|
||||
cd pgvector
|
||||
docker build -t pgvector .
|
||||
```
|
||||
|
||||
2
sql/vector--0.3.1--0.3.2.sql
Normal file
2
sql/vector--0.3.1--0.3.2.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.3.2'" to load this file. \quit
|
||||
@@ -113,23 +113,26 @@ InsertTuple(Relation rel, IndexTuple itup, Relation heapRel, Datum *values)
|
||||
newbuf = IvfflatNewBuffer(rel, MAIN_FORKNUM);
|
||||
newpage = GenericXLogRegisterBuffer(state, newbuf, GENERIC_XLOG_FULL_IMAGE);
|
||||
|
||||
/* Init new page */
|
||||
IvfflatInitPage(newbuf, newpage);
|
||||
|
||||
/* Update insert page */
|
||||
insertPage = BufferGetBlockNumber(newbuf);
|
||||
|
||||
/* Update previous buffer */
|
||||
IvfflatPageGetOpaque(page)->nextblkno = insertPage;
|
||||
|
||||
/* Init page */
|
||||
IvfflatInitPage(newbuf, newpage);
|
||||
|
||||
/* Commit */
|
||||
MarkBufferDirty(buf);
|
||||
MarkBufferDirty(newbuf);
|
||||
MarkBufferDirty(buf);
|
||||
GenericXLogFinish(state);
|
||||
|
||||
/* Unlock */
|
||||
UnlockReleaseBuffer(buf);
|
||||
UnlockReleaseBuffer(newbuf);
|
||||
/* Unlock extend relation lock as early as possible */
|
||||
UnlockReleaseBuffer(metabuf);
|
||||
|
||||
/* Unlock rest */
|
||||
UnlockReleaseBuffer(newbuf);
|
||||
UnlockReleaseBuffer(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers)
|
||||
lowerBound = palloc_extended(lowerBoundSize, MCXT_ALLOC_HUGE);
|
||||
upperBound = palloc(upperBoundSize);
|
||||
s = palloc(sSize);
|
||||
halfcdist = palloc(halfcdistSize);
|
||||
halfcdist = palloc_extended(halfcdistSize, MCXT_ALLOC_HUGE);
|
||||
newcdist = palloc(newcdistSize);
|
||||
|
||||
newCenters = VectorArrayInit(numCenters, dimensions);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
VectorArray
|
||||
VectorArrayInit(int maxlen, int dimensions)
|
||||
{
|
||||
VectorArray res = palloc0(VECTOR_ARRAY_SIZE(maxlen, dimensions));
|
||||
VectorArray res = palloc_extended(VECTOR_ARRAY_SIZE(maxlen, dimensions), MCXT_ALLOC_ZERO | MCXT_ALLOC_HUGE);
|
||||
|
||||
res->length = 0;
|
||||
res->maxlen = maxlen;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
comment = 'vector data type and ivfflat access method'
|
||||
default_version = '0.3.1'
|
||||
default_version = '0.3.2'
|
||||
module_pathname = '$libdir/vector'
|
||||
relocatable = true
|
||||
|
||||
Reference in New Issue
Block a user