Compare commits

...

4 Commits

Author SHA1 Message Date
Andrew Kane
fc5cce1cb8 Use FreeTupleDesc 2023-10-22 19:39:33 -07:00
Andrew Kane
1749ecb6e7 Copy the tuple descriptor 2023-10-22 19:36:45 -07:00
Andrew Kane
592a711a94 Fixed CI 2023-10-22 19:31:04 -07:00
Andrew Kane
139007ea68 Disabled compression for index tuples with IVFFlat 2023-10-22 19:26:25 -07:00
4 changed files with 23 additions and 2 deletions

View File

@@ -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);
}
/*

View File

@@ -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);

View File

@@ -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 */

View File

@@ -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;
}