Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/columnar.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,7 @@ extern uint64 PgColumnarItemPointerToRowNumber(ItemPointer tid);
/* -------------------------------------------------------------------------
* visibility map for index-only scans (pgcolumnar_visibilitymap.c, gap 28)
* ------------------------------------------------------------------------- */
extern void PgColumnarVMSetVisible(Relation rel, BlockNumber blk);
extern void PgColumnarVMClearVisible(Relation rel, BlockNumber blk);
extern void PgColumnarVMClearForRow(Relation rel, uint64 rowNumber);
extern bool PgColumnarVMIsVisible(Relation rel, BlockNumber blk);
extern uint64 PgColumnarVMSetVisibleForRelation(Relation rel);
extern void PgColumnarDiscardFetchCache(void);

Expand Down Expand Up @@ -427,8 +424,6 @@ typedef struct PgColumnarRowRange

/* row groups every one of whose rows is deleted as-of oldestXmin. Returns a
* List of palloc'd uint64 group numbers. */
extern List *PgColumnarComputeFullyDeletedGroups(uint64 storageId,
TransactionId oldestXmin);
extern void PgColumnarRetireGroup(uint64 storageId, uint64 groupNumber);
extern int64 PgColumnarRetireFullyDeletedGroups(Relation rel);
extern void PgColumnarLockChunkGroup(uint64 storageId, uint64 groupNumber);
Expand Down Expand Up @@ -487,8 +482,6 @@ extern List *PgColumnarReadZoneMapList(uint64 storageId, uint64 groupNumber,
Snapshot snapshot);
extern List *PgColumnarReadZoneMapVectors(uint64 storageId, uint64 groupNumber,
Snapshot snapshot);
extern List *PgColumnarReadBloomList(uint64 storageId, uint64 groupNumber,
Snapshot snapshot);
extern NativeBloomMetadata *PgColumnarReadBloomForColumn(uint64 storageId,
uint64 groupNumber,
int columnIndex,
Expand Down Expand Up @@ -838,7 +831,6 @@ extern bool PgColumnarBlockNextRun(PgColumnarBlockReader *br,
/* -------------------------------------------------------------------------
* compression (pgcolumnar_compression.c, spec 5)
* ------------------------------------------------------------------------- */
extern bool PgColumnarCodecAvailable(int compressionType);
extern void PgColumnarCompressValueStream(const char *raw, uint32 rawLen,
int requestedType, int level,
char **outData, uint32 *outLen,
Expand Down
30 changes: 0 additions & 30 deletions src/columnar_compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,6 @@
#include <zstd.h>
#endif

/*
* PgColumnarCodecAvailable
* Whether a compression type can be produced by this binary. none and
* pglz are always available; lz4 and zstd depend on the build.
*/
bool
PgColumnarCodecAvailable(int compressionType)
{
switch (compressionType)
{
case COLUMNAR_COMPRESSION_NONE:
case COLUMNAR_COMPRESSION_PGLZ:
return true;
case COLUMNAR_COMPRESSION_LZ4:
#ifdef HAVE_LIBLZ4
return true;
#else
return false;
#endif
case COLUMNAR_COMPRESSION_ZSTD:
#ifdef HAVE_LIBZSTD
return true;
#else
return false;
#endif
default:
return false;
}
}

/*
* try_pglz
* Compress with PostgreSQL's builtin pglz. Returns the compressed length
Expand Down
53 changes: 1 addition & 52 deletions src/columnar_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ PgColumnarComputeAllVisibleGroups(uint64 storageId, TransactionId oldestXmin)
* delete or any inserter to target, and old-snapshot readers keep the old
* catalog version via heap MVCC. Returns a List of palloc'd uint64.
*/
List *
static List *
PgColumnarComputeFullyDeletedGroups(uint64 storageId, TransactionId oldestXmin)
{
Relation grel = open_columnar_table("row_group", AccessShareLock);
Expand Down Expand Up @@ -1919,57 +1919,6 @@ PgColumnarInsertBloomRow(const NativeBloomMetadata *b)
table_close(rel, RowExclusiveLock);
}

/*
* PgColumnarReadBloomList
* The per-column-chunk bloom filters of one row group (native spec 7.2,
* Phase D5b). The caller indexes the result by column_index; the filter
* bytes are copied into the current memory context.
*/
List *
PgColumnarReadBloomList(uint64 storageId, uint64 groupNumber, Snapshot snapshot)
{
Relation rel = open_columnar_table("bloom", AccessShareLock);
TupleDesc tupdesc = RelationGetDescr(rel);
ScanKeyData key[2];
SysScanDesc scan;
Oid idxOid;
HeapTuple tuple;
List *result = NIL;

ScanKeyInit(&key[0], Anum_bloom_storage_id, BTEqualStrategyNumber,
F_INT8EQ, Int64GetDatum((int64) storageId));
ScanKeyInit(&key[1], Anum_bloom_group_number, BTEqualStrategyNumber,
F_INT8EQ, Int64GetDatum((int64) groupNumber));
idxOid = pgcolumnar_index_oid("bloom_pkey");
scan = systable_beginscan(rel, idxOid, OidIsValid(idxOid), snapshot,
2, key);
while (HeapTupleIsValid(tuple = systable_getnext(scan)))
{
NativeBloomMetadata *b = palloc0(sizeof(NativeBloomMetadata));
bool isnull;
Datum d;

b->storageId = storageId;
b->groupNumber = groupNumber;
b->columnIndex = DatumGetInt16(
heap_getattr(tuple, Anum_bloom_column_index, tupdesc, &isnull));
d = heap_getattr(tuple, Anum_bloom_filter, tupdesc, &isnull);
if (!isnull)
{
bytea *bf = DatumGetByteaPP(d);

b->filterLen = VARSIZE_ANY_EXHDR(bf);
b->filter = (const char *) memcpy(palloc(b->filterLen + 1),
VARDATA_ANY(bf), b->filterLen);
}
result = lappend(result, b);
}
systable_endscan(scan);
table_close(rel, AccessShareLock);

return result;
}

/*
* PgColumnarReadBloomForColumn
* One column's bloom filter for one row group, or NULL when it has none
Expand Down
6 changes: 3 additions & 3 deletions src/columnar_visibilitymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ PG_FUNCTION_INFO_V1(pgcolumnar_vm_is_visible);
* only the VM fork -- there is no heap page to flag -- which is why it does
* not go through visibilitymap_set().
*/
void
static void
PgColumnarVMSetVisible(Relation rel, BlockNumber blk)
{
Buffer vmbuf = InvalidBuffer;
Expand Down Expand Up @@ -112,7 +112,7 @@ PgColumnarVMSetVisible(Relation rel, BlockNumber blk)
* Clear the all-visible (and all-frozen) bits for `blk`, WAL-logged. Used
* by write paths so a modified range is never reported all-visible.
*/
void
static void
PgColumnarVMClearVisible(Relation rel, BlockNumber blk)
{
Buffer vmbuf = InvalidBuffer;
Expand Down Expand Up @@ -173,7 +173,7 @@ PgColumnarVMClearForRow(Relation rel, uint64 rowNumber)
* True if `blk` is marked all-visible in the VM fork. Thin wrapper over the
* stock reader (the same call the index-only-scan executor makes).
*/
bool
static bool
PgColumnarVMIsVisible(Relation rel, BlockNumber blk)
{
Buffer vmbuf = InvalidBuffer;
Expand Down
Loading