mirror of https://github.com/citusdata/citus.git
Use RelFileLocator in PG 16
This is PG commit b0a55e43299c4ea2a9a8c757f9c26352407d0cccpg16_kickoff
parent
890deac272
commit
65c88fe854
|
@ -1435,7 +1435,7 @@ ColumnarPerStripeScanCost(RelOptInfo *rel, Oid relationId, int numberOfColumnsRe
|
|||
ereport(ERROR, (errmsg("could not open relation with OID %u", relationId)));
|
||||
}
|
||||
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_node);
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_locator);
|
||||
RelationClose(relation);
|
||||
|
||||
uint32 maxColumnCount = 0;
|
||||
|
@ -1492,7 +1492,7 @@ ColumnarTableStripeCount(Oid relationId)
|
|||
ereport(ERROR, (errmsg("could not open relation with OID %u", relationId)));
|
||||
}
|
||||
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_node);
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_locator);
|
||||
int stripeCount = list_length(stripeList);
|
||||
RelationClose(relation);
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
#include "utils/memutils.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
#include "utils/relfilenodemap.h"
|
||||
#include "storage/relfilelocator.h"
|
||||
#include "utils/relfilenumbermap.h"
|
||||
|
||||
#define COLUMNAR_RELOPTION_NAMESPACE "columnar"
|
||||
#define SLOW_METADATA_ACCESS_WARNING \
|
||||
|
@ -112,7 +113,7 @@ static Oid ColumnarChunkGroupRelationId(void);
|
|||
static Oid ColumnarChunkIndexRelationId(void);
|
||||
static Oid ColumnarChunkGroupIndexRelationId(void);
|
||||
static Oid ColumnarNamespaceId(void);
|
||||
static uint64 LookupStorageId(RelFileNode relfilenode);
|
||||
static uint64 LookupStorageId(RelFileLocator relfilenode);
|
||||
static uint64 GetHighestUsedRowNumber(uint64 storageId);
|
||||
static void DeleteStorageFromColumnarMetadataTable(Oid metadataTableId,
|
||||
AttrNumber storageIdAtrrNumber,
|
||||
|
@ -591,14 +592,14 @@ ReadColumnarOptions(Oid regclass, ColumnarOptions *options)
|
|||
* of columnar.chunk.
|
||||
*/
|
||||
void
|
||||
SaveStripeSkipList(RelFileNode relfilenode, uint64 stripe, StripeSkipList *chunkList,
|
||||
SaveStripeSkipList(RelFileLocator relFileLocator, uint64 stripe, StripeSkipList *chunkList,
|
||||
TupleDesc tupleDescriptor)
|
||||
{
|
||||
uint32 columnIndex = 0;
|
||||
uint32 chunkIndex = 0;
|
||||
uint32 columnCount = chunkList->columnCount;
|
||||
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relFileLocator);
|
||||
Oid columnarChunkOid = ColumnarChunkRelationId();
|
||||
Relation columnarChunk = table_open(columnarChunkOid, RowExclusiveLock);
|
||||
ModifyState *modifyState = StartModifyRelation(columnarChunk);
|
||||
|
@ -657,10 +658,10 @@ SaveStripeSkipList(RelFileNode relfilenode, uint64 stripe, StripeSkipList *chunk
|
|||
* SaveChunkGroups saves the metadata for given chunk groups in columnar.chunk_group.
|
||||
*/
|
||||
void
|
||||
SaveChunkGroups(RelFileNode relfilenode, uint64 stripe,
|
||||
SaveChunkGroups(RelFileLocator relFileLocator, uint64 stripe,
|
||||
List *chunkGroupRowCounts)
|
||||
{
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relFileLocator);
|
||||
Oid columnarChunkGroupOid = ColumnarChunkGroupRelationId();
|
||||
Relation columnarChunkGroup = table_open(columnarChunkGroupOid, RowExclusiveLock);
|
||||
ModifyState *modifyState = StartModifyRelation(columnarChunkGroup);
|
||||
|
@ -693,7 +694,7 @@ SaveChunkGroups(RelFileNode relfilenode, uint64 stripe,
|
|||
* ReadStripeSkipList fetches chunk metadata for a given stripe.
|
||||
*/
|
||||
StripeSkipList *
|
||||
ReadStripeSkipList(RelFileNode relfilenode, uint64 stripe, TupleDesc tupleDescriptor,
|
||||
ReadStripeSkipList(RelFileLocator relfilelocator, uint64 stripe, TupleDesc tupleDescriptor,
|
||||
uint32 chunkCount, Snapshot snapshot)
|
||||
{
|
||||
int32 columnIndex = 0;
|
||||
|
@ -701,7 +702,7 @@ ReadStripeSkipList(RelFileNode relfilenode, uint64 stripe, TupleDesc tupleDescri
|
|||
uint32 columnCount = tupleDescriptor->natts;
|
||||
ScanKeyData scanKey[2];
|
||||
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relfilelocator);
|
||||
|
||||
Oid columnarChunkOid = ColumnarChunkRelationId();
|
||||
Relation columnarChunk = table_open(columnarChunkOid, AccessShareLock);
|
||||
|
@ -1239,9 +1240,9 @@ InsertEmptyStripeMetadataRow(uint64 storageId, uint64 stripeId, uint32 columnCou
|
|||
* of the given relfilenode.
|
||||
*/
|
||||
List *
|
||||
StripesForRelfilenode(RelFileNode relfilenode)
|
||||
StripesForRelfilenode(RelFileLocator relFileLocator)
|
||||
{
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relFileLocator);
|
||||
|
||||
return ReadDataFileStripeList(storageId, GetTransactionSnapshot());
|
||||
}
|
||||
|
@ -1256,9 +1257,9 @@ StripesForRelfilenode(RelFileNode relfilenode)
|
|||
* returns 0.
|
||||
*/
|
||||
uint64
|
||||
GetHighestUsedAddress(RelFileNode relfilenode)
|
||||
GetHighestUsedAddress(RelFileLocator relfilelocator)
|
||||
{
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relfilelocator);
|
||||
|
||||
uint64 highestUsedAddress = 0;
|
||||
uint64 highestUsedId = 0;
|
||||
|
@ -1539,7 +1540,7 @@ BuildStripeMetadata(Relation columnarStripes, HeapTuple heapTuple)
|
|||
* metadata tables.
|
||||
*/
|
||||
void
|
||||
DeleteMetadataRows(RelFileNode relfilenode)
|
||||
DeleteMetadataRows(RelFileLocator relFileLocator)
|
||||
{
|
||||
/*
|
||||
* During a restore for binary upgrade, metadata tables and indexes may or
|
||||
|
@ -1550,7 +1551,7 @@ DeleteMetadataRows(RelFileNode relfilenode)
|
|||
return;
|
||||
}
|
||||
|
||||
uint64 storageId = LookupStorageId(relfilenode);
|
||||
uint64 storageId = LookupStorageId(relFileLocator);
|
||||
|
||||
DeleteStorageFromColumnarMetadataTable(ColumnarStripeRelationId(),
|
||||
Anum_columnar_stripe_storageid,
|
||||
|
@ -1934,10 +1935,10 @@ ColumnarNamespaceId(void)
|
|||
* false if the relation doesn't have a meta page yet.
|
||||
*/
|
||||
static uint64
|
||||
LookupStorageId(RelFileNode relfilenode)
|
||||
LookupStorageId(RelFileLocator relfilenode)
|
||||
{
|
||||
Oid relationId = RelidByRelfilenode(relfilenode.spcNode,
|
||||
relfilenode.relNode);
|
||||
Oid relationId = RelidByRelfilenumber(relfilenode.spcOid,
|
||||
relfilenode.relNumber);
|
||||
|
||||
Relation relation = relation_open(relationId, AccessShareLock);
|
||||
uint64 storageId = ColumnarStorageGetStorageId(relation, false);
|
||||
|
|
|
@ -254,7 +254,7 @@ ColumnarReadFlushPendingWrites(ColumnarReadState *readState)
|
|||
{
|
||||
Assert(!readState->snapshotRegisteredByUs);
|
||||
|
||||
Oid relfilenode = readState->relation->rd_node.relNode;
|
||||
Oid relfilenode = readState->relation->rd_locator.relNumber;
|
||||
FlushWriteStateForRelfilenode(relfilenode, GetCurrentSubTransactionId());
|
||||
|
||||
if (readState->snapshot == InvalidSnapshot || !IsMVCCSnapshot(readState->snapshot))
|
||||
|
@ -984,7 +984,7 @@ ColumnarTableRowCount(Relation relation)
|
|||
{
|
||||
ListCell *stripeMetadataCell = NULL;
|
||||
uint64 totalRowCount = 0;
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_node);
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_locator);
|
||||
|
||||
foreach(stripeMetadataCell, stripeList)
|
||||
{
|
||||
|
@ -1012,7 +1012,7 @@ LoadFilteredStripeBuffers(Relation relation, StripeMetadata *stripeMetadata,
|
|||
|
||||
bool *projectedColumnMask = ProjectedColumnMask(columnCount, projectedColumnList);
|
||||
|
||||
StripeSkipList *stripeSkipList = ReadStripeSkipList(relation->rd_node,
|
||||
StripeSkipList *stripeSkipList = ReadStripeSkipList(relation->rd_locator,
|
||||
stripeMetadata->id,
|
||||
tupleDescriptor,
|
||||
stripeMetadata->chunkCount,
|
||||
|
|
|
@ -188,7 +188,7 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId)
|
|||
(char *) &metapage, sizeof(ColumnarMetapage));
|
||||
phdr->pd_lower += sizeof(ColumnarMetapage);
|
||||
|
||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||
log_newpage(&srel->smgr_rlocator.locator, MAIN_FORKNUM,
|
||||
COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||
PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO);
|
||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||
|
@ -196,7 +196,7 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId)
|
|||
/* write empty page */
|
||||
PageInit(page, BLCKSZ, 0);
|
||||
|
||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||
log_newpage(&srel->smgr_rlocator.locator, MAIN_FORKNUM,
|
||||
COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||
PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO);
|
||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||
|
|
|
@ -208,7 +208,7 @@ columnar_beginscan_extended(Relation relation, Snapshot snapshot,
|
|||
uint32 flags, Bitmapset *attr_needed, List *scanQual)
|
||||
{
|
||||
CheckCitusColumnarVersion(ERROR);
|
||||
Oid relfilenode = relation->rd_node.relNode;
|
||||
Oid relfilenode = relation->rd_locator.relNumber;
|
||||
|
||||
/*
|
||||
* A memory context to use for scan-wide data, including the lazily
|
||||
|
@ -434,7 +434,7 @@ columnar_index_fetch_begin(Relation rel)
|
|||
{
|
||||
CheckCitusColumnarVersion(ERROR);
|
||||
|
||||
Oid relfilenode = rel->rd_node.relNode;
|
||||
Oid relfilenode = rel->rd_locator.relNumber;
|
||||
if (PendingWritesInUpperTransactions(relfilenode, GetCurrentSubTransactionId()))
|
||||
{
|
||||
/* XXX: maybe we can just flush the data and continue */
|
||||
|
@ -857,8 +857,8 @@ columnar_finish_bulk_insert(Relation relation, int options)
|
|||
|
||||
|
||||
static void
|
||||
columnar_relation_set_new_filenode(Relation rel,
|
||||
const RelFileNode *newrnode,
|
||||
columnar_relation_set_new_filelocator(Relation rel,
|
||||
const RelFileLocator *newlocator,
|
||||
char persistence,
|
||||
TransactionId *freezeXid,
|
||||
MultiXactId *minmulti)
|
||||
|
@ -877,16 +877,16 @@ columnar_relation_set_new_filenode(Relation rel,
|
|||
* state. If they are equal, this is a new relation object and we don't
|
||||
* need to clean anything.
|
||||
*/
|
||||
if (rel->rd_node.relNode != newrnode->relNode)
|
||||
if (rel->rd_locator.relNumber != newlocator->relNumber)
|
||||
{
|
||||
MarkRelfilenodeDropped(rel->rd_node.relNode, GetCurrentSubTransactionId());
|
||||
MarkRelfilenodeDropped(rel->rd_locator.relNumber, GetCurrentSubTransactionId());
|
||||
|
||||
DeleteMetadataRows(rel->rd_node);
|
||||
DeleteMetadataRows(rel->rd_locator);
|
||||
}
|
||||
|
||||
*freezeXid = RecentXmin;
|
||||
*minmulti = GetOldestMultiXactId();
|
||||
SMgrRelation srel = RelationCreateStorage_compat(*newrnode, persistence, true);
|
||||
SMgrRelation srel = RelationCreateStorage_compat(*newlocator, persistence, true);
|
||||
|
||||
ColumnarStorageInit(srel, ColumnarMetadataNewStorageId());
|
||||
InitColumnarOptions(rel->rd_id);
|
||||
|
@ -901,12 +901,12 @@ static void
|
|||
columnar_relation_nontransactional_truncate(Relation rel)
|
||||
{
|
||||
CheckCitusColumnarVersion(ERROR);
|
||||
RelFileNode relfilenode = rel->rd_node;
|
||||
RelFileLocator relFileLocator = rel->rd_locator;
|
||||
|
||||
NonTransactionDropWriteState(relfilenode.relNode);
|
||||
NonTransactionDropWriteState(relFileLocator.relNumber);
|
||||
|
||||
/* Delete old relfilenode metadata */
|
||||
DeleteMetadataRows(relfilenode);
|
||||
DeleteMetadataRows(relFileLocator);
|
||||
|
||||
/*
|
||||
* No need to set new relfilenode, since the table was created in this
|
||||
|
@ -923,7 +923,7 @@ columnar_relation_nontransactional_truncate(Relation rel)
|
|||
|
||||
|
||||
static void
|
||||
columnar_relation_copy_data(Relation rel, const RelFileNode *newrnode)
|
||||
columnar_relation_copy_data(Relation rel, const RelFileLocator *newrnode)
|
||||
{
|
||||
elog(ERROR, "columnar_relation_copy_data not implemented");
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ columnar_relation_copy_for_cluster(Relation OldHeap, Relation NewHeap,
|
|||
ColumnarOptions columnarOptions = { 0 };
|
||||
ReadColumnarOptions(OldHeap->rd_id, &columnarOptions);
|
||||
|
||||
ColumnarWriteState *writeState = ColumnarBeginWrite(NewHeap->rd_node,
|
||||
ColumnarWriteState *writeState = ColumnarBeginWrite(NewHeap->rd_locator,
|
||||
columnarOptions,
|
||||
targetDesc);
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ NeededColumnsList(TupleDesc tupdesc, Bitmapset *attr_needed)
|
|||
static uint64
|
||||
ColumnarTableTupleCount(Relation relation)
|
||||
{
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_node);
|
||||
List *stripeList = StripesForRelfilenode(relation->rd_locator);
|
||||
uint64 tupleCount = 0;
|
||||
|
||||
ListCell *lc = NULL;
|
||||
|
@ -1182,7 +1182,7 @@ static void
|
|||
LogRelationStats(Relation rel, int elevel)
|
||||
{
|
||||
ListCell *stripeMetadataCell = NULL;
|
||||
RelFileNode relfilenode = rel->rd_node;
|
||||
RelFileLocator relfilelocator = rel->rd_locator;
|
||||
StringInfo infoBuf = makeStringInfo();
|
||||
|
||||
int compressionStats[COMPRESSION_COUNT] = { 0 };
|
||||
|
@ -1193,13 +1193,13 @@ LogRelationStats(Relation rel, int elevel)
|
|||
uint64 droppedChunksWithData = 0;
|
||||
uint64 totalDecompressedLength = 0;
|
||||
|
||||
List *stripeList = StripesForRelfilenode(relfilenode);
|
||||
List *stripeList = StripesForRelfilenode(relfilelocator);
|
||||
int stripeCount = list_length(stripeList);
|
||||
|
||||
foreach(stripeMetadataCell, stripeList)
|
||||
{
|
||||
StripeMetadata *stripe = lfirst(stripeMetadataCell);
|
||||
StripeSkipList *skiplist = ReadStripeSkipList(relfilenode, stripe->id,
|
||||
StripeSkipList *skiplist = ReadStripeSkipList(relfilelocator, stripe->id,
|
||||
RelationGetDescr(rel),
|
||||
stripe->chunkCount,
|
||||
GetTransactionSnapshot());
|
||||
|
@ -1335,7 +1335,7 @@ TruncateColumnar(Relation rel, int elevel)
|
|||
* new stripes be added beyond highestPhysicalAddress while
|
||||
* we're truncating.
|
||||
*/
|
||||
uint64 newDataReservation = Max(GetHighestUsedAddress(rel->rd_node) + 1,
|
||||
uint64 newDataReservation = Max(GetHighestUsedAddress(rel->rd_locator) + 1,
|
||||
ColumnarFirstLogicalOffset);
|
||||
|
||||
BlockNumber old_rel_pages = smgrnblocks(RelationGetSmgr(rel), MAIN_FORKNUM);
|
||||
|
@ -2085,12 +2085,12 @@ ColumnarTableDropHook(Oid relid)
|
|||
* tableam tables storage is managed by postgres.
|
||||
*/
|
||||
Relation rel = table_open(relid, AccessExclusiveLock);
|
||||
RelFileNode relfilenode = rel->rd_node;
|
||||
RelFileLocator relfilenode = rel->rd_locator;
|
||||
|
||||
DeleteMetadataRows(relfilenode);
|
||||
DeleteColumnarTableOptions(rel->rd_id, true);
|
||||
|
||||
MarkRelfilenodeDropped(relfilenode.relNode, GetCurrentSubTransactionId());
|
||||
MarkRelfilenodeDropped(relfilenode.relNumber, GetCurrentSubTransactionId());
|
||||
|
||||
/* keep the lock since we did physical changes to the relation */
|
||||
table_close(rel, NoLock);
|
||||
|
@ -2515,7 +2515,7 @@ static const TableAmRoutine columnar_am_methods = {
|
|||
.tuple_lock = columnar_tuple_lock,
|
||||
.finish_bulk_insert = columnar_finish_bulk_insert,
|
||||
|
||||
.relation_set_new_filenode = columnar_relation_set_new_filenode,
|
||||
.relation_set_new_filelocator = columnar_relation_set_new_filelocator,
|
||||
.relation_nontransactional_truncate = columnar_relation_nontransactional_truncate,
|
||||
.relation_copy_data = columnar_relation_copy_data,
|
||||
.relation_copy_for_cluster = columnar_relation_copy_for_cluster,
|
||||
|
|
|
@ -37,7 +37,7 @@ struct ColumnarWriteState
|
|||
{
|
||||
TupleDesc tupleDescriptor;
|
||||
FmgrInfo **comparisonFunctionArray;
|
||||
RelFileNode relfilenode;
|
||||
RelFileLocator relfilelocator;
|
||||
|
||||
MemoryContext stripeWriteContext;
|
||||
MemoryContext perTupleContext;
|
||||
|
@ -84,7 +84,7 @@ static StringInfo CopyStringInfo(StringInfo sourceString);
|
|||
* data load operation.
|
||||
*/
|
||||
ColumnarWriteState *
|
||||
ColumnarBeginWrite(RelFileNode relfilenode,
|
||||
ColumnarBeginWrite(RelFileLocator relFileLocator,
|
||||
ColumnarOptions options,
|
||||
TupleDesc tupleDescriptor)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ ColumnarBeginWrite(RelFileNode relfilenode,
|
|||
options.chunkRowCount);
|
||||
|
||||
ColumnarWriteState *writeState = palloc0(sizeof(ColumnarWriteState));
|
||||
writeState->relfilenode = relfilenode;
|
||||
writeState->relfilelocator = relFileLocator;
|
||||
writeState->options = options;
|
||||
writeState->tupleDescriptor = CreateTupleDescCopy(tupleDescriptor);
|
||||
writeState->comparisonFunctionArray = comparisonFunctionArray;
|
||||
|
@ -174,8 +174,8 @@ ColumnarWriteRow(ColumnarWriteState *writeState, Datum *columnValues, bool *colu
|
|||
writeState->stripeSkipList = stripeSkipList;
|
||||
writeState->compressionBuffer = makeStringInfo();
|
||||
|
||||
Oid relationId = RelidByRelfilenode(writeState->relfilenode.spcNode,
|
||||
writeState->relfilenode.relNode);
|
||||
Oid relationId = RelidByRelfilenode(writeState->relfilelocator.spcOid,
|
||||
writeState->relfilelocator.relNumber);
|
||||
Relation relation = relation_open(relationId, NoLock);
|
||||
writeState->emptyStripeReservation =
|
||||
ReserveEmptyStripe(relation, columnCount, chunkRowCount,
|
||||
|
@ -393,8 +393,8 @@ FlushStripe(ColumnarWriteState *writeState)
|
|||
|
||||
elog(DEBUG1, "Flushing Stripe of size %d", stripeBuffers->rowCount);
|
||||
|
||||
Oid relationId = RelidByRelfilenode(writeState->relfilenode.spcNode,
|
||||
writeState->relfilenode.relNode);
|
||||
Oid relationId = RelidByRelfilenode(writeState->relfilelocator.spcNode,
|
||||
writeState->relfilelocator.relNode);
|
||||
Relation relation = relation_open(relationId, NoLock);
|
||||
|
||||
/*
|
||||
|
@ -486,10 +486,10 @@ FlushStripe(ColumnarWriteState *writeState)
|
|||
}
|
||||
}
|
||||
|
||||
SaveChunkGroups(writeState->relfilenode,
|
||||
SaveChunkGroups(writeState->relfilelocator,
|
||||
stripeMetadata->id,
|
||||
writeState->chunkGroupRowCounts);
|
||||
SaveStripeSkipList(writeState->relfilenode,
|
||||
SaveStripeSkipList(writeState->relfilelocator,
|
||||
stripeMetadata->id,
|
||||
stripeSkipList, tupleDescriptor);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ columnar_init_write_state(Relation relation, TupleDesc tupdesc,
|
|||
MemoryContextRegisterResetCallback(WriteStateContext, &cleanupCallback);
|
||||
}
|
||||
|
||||
WriteStateMapEntry *hashEntry = hash_search(WriteStateMap, &relation->rd_node.relNode,
|
||||
WriteStateMapEntry *hashEntry = hash_search(WriteStateMap, &relation->rd_locator.relNumber,
|
||||
HASH_ENTER, &found);
|
||||
if (!found)
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ columnar_init_write_state(Relation relation, TupleDesc tupdesc,
|
|||
ReadColumnarOptions(tupSlotRelationId, &columnarOptions);
|
||||
|
||||
SubXidWriteState *stackEntry = palloc0(sizeof(SubXidWriteState));
|
||||
stackEntry->writeState = ColumnarBeginWrite(relation->rd_node,
|
||||
stackEntry->writeState = ColumnarBeginWrite(relation->rd_locator,
|
||||
columnarOptions,
|
||||
tupdesc);
|
||||
stackEntry->subXid = currentSubXid;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "nodes/parsenodes.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "storage/lockdefs.h"
|
||||
#include "storage/relfilenode.h"
|
||||
#include "storage/relfilelocator.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/snapmgr.h"
|
||||
|
||||
|
@ -224,7 +224,7 @@ extern void columnar_init_gucs(void);
|
|||
extern CompressionType ParseCompressionType(const char *compressionTypeString);
|
||||
|
||||
/* Function declarations for writing to a columnar table */
|
||||
extern ColumnarWriteState * ColumnarBeginWrite(RelFileNode relfilenode,
|
||||
extern ColumnarWriteState * ColumnarBeginWrite(RelFileLocator relfilenode,
|
||||
ColumnarOptions options,
|
||||
TupleDesc tupleDescriptor);
|
||||
extern uint64 ColumnarWriteRow(ColumnarWriteState *state, Datum *columnValues,
|
||||
|
@ -279,21 +279,21 @@ extern bool ReadColumnarOptions(Oid regclass, ColumnarOptions *options);
|
|||
extern bool IsColumnarTableAmTable(Oid relationId);
|
||||
|
||||
/* columnar_metadata_tables.c */
|
||||
extern void DeleteMetadataRows(RelFileNode relfilenode);
|
||||
extern void DeleteMetadataRows(RelFileLocator relFileLocator);
|
||||
extern uint64 ColumnarMetadataNewStorageId(void);
|
||||
extern uint64 GetHighestUsedAddress(RelFileNode relfilenode);
|
||||
extern uint64 GetHighestUsedAddress(RelFileLocator relFileLocator);
|
||||
extern EmptyStripeReservation * ReserveEmptyStripe(Relation rel, uint64 columnCount,
|
||||
uint64 chunkGroupRowCount,
|
||||
uint64 stripeRowCount);
|
||||
extern StripeMetadata * CompleteStripeReservation(Relation rel, uint64 stripeId,
|
||||
uint64 sizeBytes, uint64 rowCount,
|
||||
uint64 chunkCount);
|
||||
extern void SaveStripeSkipList(RelFileNode relfilenode, uint64 stripe,
|
||||
extern void SaveStripeSkipList(RelFileLocator relFileLocator, uint64 stripe,
|
||||
StripeSkipList *stripeSkipList,
|
||||
TupleDesc tupleDescriptor);
|
||||
extern void SaveChunkGroups(RelFileNode relfilenode, uint64 stripe,
|
||||
extern void SaveChunkGroups(RelFileLocator relFileLocator, uint64 stripe,
|
||||
List *chunkGroupRowCounts);
|
||||
extern StripeSkipList * ReadStripeSkipList(RelFileNode relfilenode, uint64 stripe,
|
||||
extern StripeSkipList * ReadStripeSkipList(RelFileLocator relFileLocator, uint64 stripe,
|
||||
TupleDesc tupleDescriptor,
|
||||
uint32 chunkCount,
|
||||
Snapshot snapshot);
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef struct EmptyStripeReservation
|
|||
uint64 stripeFirstRowNumber;
|
||||
} EmptyStripeReservation;
|
||||
|
||||
extern List * StripesForRelfilenode(RelFileNode relfilenode);
|
||||
extern List * StripesForRelfilenode(RelFileLocator relfilelocator);
|
||||
extern void ColumnarStorageUpdateIfNeeded(Relation rel, bool isUpgrade);
|
||||
extern List * ExtractColumnarRelOptions(List *inOptions, List **outColumnarOptions);
|
||||
extern void SetColumnarRelOptions(RangeVar *rv, List *reloptions);
|
||||
|
|
Loading…
Reference in New Issue