mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-22 03:57:34 +08:00
Compare commits
6 Commits
v0.5.1
...
ivfflat-st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc5cce1cb8 | ||
|
|
1749ecb6e7 | ||
|
|
592a711a94 | ||
|
|
139007ea68 | ||
|
|
3f49b95f01 | ||
|
|
ef1bea7163 |
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -8,6 +8,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- postgres: 17
|
||||
os: ubuntu-22.04
|
||||
- postgres: 16
|
||||
os: ubuntu-22.04
|
||||
- postgres: 15
|
||||
@@ -21,7 +23,7 @@ jobs:
|
||||
- postgres: 11
|
||||
os: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ankane/setup-postgres@v1
|
||||
with:
|
||||
postgres-version: ${{ matrix.postgres }}
|
||||
@@ -43,7 +45,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
if: ${{ !startsWith(github.ref_name, 'windows') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ankane/setup-postgres@v1
|
||||
with:
|
||||
postgres-version: 14
|
||||
@@ -65,7 +67,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
if: ${{ !startsWith(github.ref_name, 'mac') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ankane/setup-postgres@v1
|
||||
with:
|
||||
postgres-version: 14
|
||||
|
||||
@@ -287,7 +287,7 @@ InsertTuples(Relation index, IvfflatBuildState * buildstate, ForkNumber forkNum)
|
||||
#else
|
||||
TupleTableSlot *slot = MakeSingleTupleTableSlot(buildstate->tupdesc);
|
||||
#endif
|
||||
TupleDesc tupdesc = RelationGetDescr(index);
|
||||
TupleDesc tupdesc = IvfflatTupleDesc(index);
|
||||
|
||||
UpdateProgress(PROGRESS_CREATEIDX_SUBPHASE, PROGRESS_IVFFLAT_PHASE_LOAD);
|
||||
|
||||
@@ -339,6 +339,8 @@ InsertTuples(Relation index, IvfflatBuildState * buildstate, ForkNumber forkNum)
|
||||
/* Set the start and insert pages */
|
||||
IvfflatUpdateList(index, buildstate->listInfo[i], insertPage, InvalidBlockNumber, startPage, forkNum);
|
||||
}
|
||||
|
||||
FreeTupleDesc(tupdesc);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -287,6 +287,7 @@ void IvfflatInitPage(Buffer buf, Page page);
|
||||
void IvfflatInitRegisterPage(Relation index, Buffer *buf, Page *page, GenericXLogState **state);
|
||||
void IvfflatInit(void);
|
||||
PGDLLEXPORT void IvfflatParallelBuildMain(dsm_segment *seg, shm_toc *toc);
|
||||
TupleDesc IvfflatTupleDesc(Relation index);
|
||||
|
||||
/* Index access methods */
|
||||
IndexBuildResult *ivfflatbuild(Relation heap, Relation index, IndexInfo *indexInfo);
|
||||
|
||||
@@ -94,7 +94,7 @@ InsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heap_tid, R
|
||||
originalInsertPage = insertPage;
|
||||
|
||||
/* Form tuple */
|
||||
itup = index_form_tuple(RelationGetDescr(index), &value, isnull);
|
||||
itup = index_form_tuple(IvfflatTupleDesc(index), &value, isnull);
|
||||
itup->t_tid = *heap_tid;
|
||||
|
||||
/* Get tuple size */
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "storage/bufmgr.h"
|
||||
#include "vector.h"
|
||||
|
||||
#if PG_VERSION_NUM < 130000
|
||||
#define TYPSTORAGE_PLAIN 'p'
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allocate a vector array
|
||||
*/
|
||||
@@ -238,3 +242,17 @@ IvfflatUpdateList(Relation index, ListInfo listInfo,
|
||||
UnlockReleaseBuffer(buf);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the tuple descriptor
|
||||
*/
|
||||
TupleDesc
|
||||
IvfflatTupleDesc(Relation index)
|
||||
{
|
||||
TupleDesc tupdesc = CreateTupleDescCopyConstr(RelationGetDescr(index));
|
||||
|
||||
/* Prevent compression */
|
||||
TupleDescAttr(tupdesc, 0)->attstorage = TYPSTORAGE_PLAIN;
|
||||
|
||||
return tupdesc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user