mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-22 20:15:46 +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
|
- uses: ankane/setup-postgres@v1
|
||||||
with:
|
with:
|
||||||
postgres-version: ${{ matrix.postgres }}
|
postgres-version: ${{ matrix.postgres }}
|
||||||
|
dev-files: true
|
||||||
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
- 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
|
- run: make
|
||||||
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
## 0.3.2 (2022-11-22)
|
||||||
|
|
||||||
|
- Fixed `invalid memory alloc request size` error
|
||||||
|
|
||||||
## 0.3.1 (2022-11-02)
|
## 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.
|
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",
|
"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.3.1",
|
"version": "0.3.2",
|
||||||
"maintainer": [
|
"maintainer": [
|
||||||
"Andrew Kane <andrew@ankane.org>"
|
"Andrew Kane <andrew@ankane.org>"
|
||||||
],
|
],
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"vector": {
|
"vector": {
|
||||||
"file": "sql/vector.sql",
|
"file": "sql/vector.sql",
|
||||||
"docfile": "README.md",
|
"docfile": "README.md",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"abstract": "Open-source vector similarity search for Postgres"
|
"abstract": "Open-source vector similarity search for Postgres"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -1,5 +1,5 @@
|
|||||||
EXTENSION = vector
|
EXTENSION = vector
|
||||||
EXTVERSION = 0.3.1
|
EXTVERSION = 0.3.2
|
||||||
|
|
||||||
MODULE_big = vector
|
MODULE_big = vector
|
||||||
DATA = $(wildcard sql/*--*.sql)
|
DATA = $(wildcard sql/*--*.sql)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Supports L2 distance, inner product, and cosine distance
|
|||||||
Compile and install the extension (supports Postgres 10+)
|
Compile and install the extension (supports Postgres 10+)
|
||||||
|
|
||||||
```sh
|
```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
|
cd pgvector
|
||||||
make
|
make
|
||||||
make install # may need sudo
|
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
|
You can also build the image manually
|
||||||
|
|
||||||
```sh
|
```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
|
cd pgvector
|
||||||
docker build -t 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);
|
newbuf = IvfflatNewBuffer(rel, MAIN_FORKNUM);
|
||||||
newpage = GenericXLogRegisterBuffer(state, newbuf, GENERIC_XLOG_FULL_IMAGE);
|
newpage = GenericXLogRegisterBuffer(state, newbuf, GENERIC_XLOG_FULL_IMAGE);
|
||||||
|
|
||||||
|
/* Init new page */
|
||||||
|
IvfflatInitPage(newbuf, newpage);
|
||||||
|
|
||||||
|
/* Update insert page */
|
||||||
insertPage = BufferGetBlockNumber(newbuf);
|
insertPage = BufferGetBlockNumber(newbuf);
|
||||||
|
|
||||||
/* Update previous buffer */
|
/* Update previous buffer */
|
||||||
IvfflatPageGetOpaque(page)->nextblkno = insertPage;
|
IvfflatPageGetOpaque(page)->nextblkno = insertPage;
|
||||||
|
|
||||||
/* Init page */
|
|
||||||
IvfflatInitPage(newbuf, newpage);
|
|
||||||
|
|
||||||
/* Commit */
|
/* Commit */
|
||||||
MarkBufferDirty(buf);
|
|
||||||
MarkBufferDirty(newbuf);
|
MarkBufferDirty(newbuf);
|
||||||
|
MarkBufferDirty(buf);
|
||||||
GenericXLogFinish(state);
|
GenericXLogFinish(state);
|
||||||
|
|
||||||
/* Unlock */
|
/* Unlock extend relation lock as early as possible */
|
||||||
UnlockReleaseBuffer(buf);
|
|
||||||
UnlockReleaseBuffer(newbuf);
|
|
||||||
UnlockReleaseBuffer(metabuf);
|
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);
|
lowerBound = palloc_extended(lowerBoundSize, MCXT_ALLOC_HUGE);
|
||||||
upperBound = palloc(upperBoundSize);
|
upperBound = palloc(upperBoundSize);
|
||||||
s = palloc(sSize);
|
s = palloc(sSize);
|
||||||
halfcdist = palloc(halfcdistSize);
|
halfcdist = palloc_extended(halfcdistSize, MCXT_ALLOC_HUGE);
|
||||||
newcdist = palloc(newcdistSize);
|
newcdist = palloc(newcdistSize);
|
||||||
|
|
||||||
newCenters = VectorArrayInit(numCenters, dimensions);
|
newCenters = VectorArrayInit(numCenters, dimensions);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
VectorArray
|
VectorArray
|
||||||
VectorArrayInit(int maxlen, int dimensions)
|
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->length = 0;
|
||||||
res->maxlen = maxlen;
|
res->maxlen = maxlen;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
comment = 'vector data type and ivfflat access method'
|
comment = 'vector data type and ivfflat access method'
|
||||||
default_version = '0.3.1'
|
default_version = '0.3.2'
|
||||||
module_pathname = '$libdir/vector'
|
module_pathname = '$libdir/vector'
|
||||||
relocatable = true
|
relocatable = true
|
||||||
|
|||||||
Reference in New Issue
Block a user