PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include "access/gin_private.h"
#include "utils/datum.h"
#include "utils/memutils.h"
Go to the source code of this file.
Macros | |
#define | DEF_NENTRY 2048 /* GinEntryAccumulator allocation quantum */ |
#define | DEF_NPTR 5 /* ItemPointer initial allocation quantum */ |
Functions | |
static void | ginCombineData (RBTNode *existing, const RBTNode *newdata, void *arg) |
static int | cmpEntryAccumulator (const RBTNode *a, const RBTNode *b, void *arg) |
static RBTNode * | ginAllocEntryAccumulator (void *arg) |
void | ginInitBA (BuildAccumulator *accum) |
static Datum | getDatumCopy (BuildAccumulator *accum, OffsetNumber attnum, Datum value) |
static void | ginInsertBAEntry (BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum key, GinNullCategory category) |
void | ginInsertBAEntries (BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum *entries, GinNullCategory *categories, int32 nentries) |
static int | qsortCompareItemPointers (const void *a, const void *b) |
void | ginBeginBAScan (BuildAccumulator *accum) |
ItemPointerData * | ginGetBAEntry (BuildAccumulator *accum, OffsetNumber *attnum, Datum *key, GinNullCategory *category, uint32 *n) |
#define DEF_NENTRY 2048 /* GinEntryAccumulator allocation quantum */ |
#define DEF_NPTR 5 /* ItemPointer initial allocation quantum */ |
Definition at line 72 of file ginbulk.c.
References a, arg, GinEntryAccumulator::attnum, b, GinEntryAccumulator::category, ginCompareAttEntries(), BuildAccumulator::ginstate, and GinEntryAccumulator::key.
Referenced by ginInitBA().
|
static |
Definition at line 128 of file ginbulk.c.
References BuildAccumulator::allocatedMemory, attnum, datumCopy(), DatumGetPointer(), GetMemoryChunkSpace(), BuildAccumulator::ginstate, GinState::origTupdesc, res, TupleDescAttr, and value.
Referenced by ginInsertBAEntry().
|
static |
Definition at line 85 of file ginbulk.c.
References BuildAccumulator::allocatedMemory, arg, DEF_NENTRY, BuildAccumulator::eas_used, BuildAccumulator::entryallocator, GetMemoryChunkSpace(), and palloc().
Referenced by ginInitBA().
void ginBeginBAScan | ( | BuildAccumulator * | accum | ) |
Definition at line 257 of file ginbulk.c.
References LeftRightWalk, rbt_begin_iterate(), BuildAccumulator::tree, and BuildAccumulator::tree_walk.
Referenced by ginbuild(), ginBuildCallback(), and ginInsertCleanup().
Definition at line 30 of file ginbulk.c.
References BuildAccumulator::allocatedMemory, arg, Assert, GinEntryAccumulator::count, ereport, errcode(), errhint(), errmsg(), ERROR, GetMemoryChunkSpace(), ginCompareItemPointers(), GinEntryAccumulator::list, GinEntryAccumulator::maxcount, repalloc_huge(), res, and GinEntryAccumulator::shouldSort.
Referenced by ginInitBA().
ItemPointerData* ginGetBAEntry | ( | BuildAccumulator * | accum, |
OffsetNumber * | attnum, | ||
Datum * | key, | ||
GinNullCategory * | category, | ||
uint32 * | n | ||
) |
Definition at line 268 of file ginbulk.c.
References Assert, GinEntryAccumulator::attnum, attnum, GinEntryAccumulator::category, GinEntryAccumulator::count, GinEntryAccumulator::key, sort-test::key, GinEntryAccumulator::list, sort-test::list, qsort, qsortCompareItemPointers(), rbt_iterate(), GinEntryAccumulator::shouldSort, and BuildAccumulator::tree_walk.
Referenced by ginbuild(), ginBuildCallback(), and ginInsertCleanup().
void ginInitBA | ( | BuildAccumulator * | accum | ) |
Definition at line 109 of file ginbulk.c.
References BuildAccumulator::allocatedMemory, cmpEntryAccumulator(), BuildAccumulator::eas_used, BuildAccumulator::entryallocator, ginAllocEntryAccumulator(), ginCombineData(), rbt_create(), and BuildAccumulator::tree.
Referenced by ginbuild(), ginBuildCallback(), and ginInsertCleanup().
void ginInsertBAEntries | ( | BuildAccumulator * | accum, |
ItemPointer | heapptr, | ||
OffsetNumber | attnum, | ||
Datum * | entries, | ||
GinNullCategory * | categories, | ||
int32 | nentries | ||
) |
Definition at line 210 of file ginbulk.c.
References Assert, attnum, FirstOffsetNumber, ginInsertBAEntry(), i, and ItemPointerIsValid().
Referenced by ginHeapTupleBulkInsert(), and processPendingPage().
|
static |
Definition at line 148 of file ginbulk.c.
References BuildAccumulator::allocatedMemory, GinEntryAccumulator::attnum, attnum, GinEntryAccumulator::category, GinEntryAccumulator::count, DEF_NPTR, getDatumCopy(), GetMemoryChunkSpace(), GIN_CAT_NORM_KEY, GinEntryAccumulator::key, sort-test::key, GinEntryAccumulator::list, GinEntryAccumulator::maxcount, palloc(), rbt_insert(), GinEntryAccumulator::shouldSort, and BuildAccumulator::tree.
Referenced by ginInsertBAEntries().
|
static |
Definition at line 246 of file ginbulk.c.
References a, Assert, b, ginCompareItemPointers(), and res.
Referenced by ginGetBAEntry().