PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/gist_private.h"
#include "storage/buffile.h"
#include "storage/bufmgr.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | RelocationBufferInfo |
|
static |
Definition at line 198 of file gistbuildbuffers.c.
References GISTNodeBuffer::isTemp, GISTBuildBuffers::loadedBuffers, GISTBuildBuffers::loadedBuffersCount, GISTBuildBuffers::loadedBuffersLen, and repalloc().
Referenced by gistLoadNodeBuffer(), and gistPushItupToNodeBuffer().
|
static |
Definition at line 181 of file gistbuildbuffers.c.
References BUFFER_PAGE_DATA_OFFSET, GISTBuildBuffers::context, InvalidBlockNumber, MemoryContextAllocZero(), PAGE_FREE_SPACE, and GISTNodeBufferPage::prev.
Referenced by gistLoadNodeBuffer(), and gistPushItupToNodeBuffer().
|
static |
Definition at line 468 of file gistbuildbuffers.c.
References GISTBuildBuffers::freeBlocks, GISTBuildBuffers::nFileBlocks, and GISTBuildBuffers::nFreeBlocks.
Referenced by gistPushItupToNodeBuffer(), and gistUnloadNodeBuffer().
|
static |
Definition at line 485 of file gistbuildbuffers.c.
References GISTBuildBuffers::freeBlocks, GISTBuildBuffers::freeBlocksLen, GISTBuildBuffers::nFreeBlocks, and repalloc().
Referenced by gistLoadNodeBuffer(), and gistPopItupFromNodeBuffer().
void gistFreeBuildBuffers | ( | GISTBuildBuffers * | gfbb | ) |
Definition at line 507 of file gistbuildbuffers.c.
References BufFileClose(), and GISTBuildBuffers::pfile.
Referenced by gistbuild().
|
static |
Definition at line 311 of file gistbuildbuffers.c.
References Assert, BUFFER_PAGE_DATA_OFFSET, IndexTupleSize, MAXALIGN, PAGE_FREE_SPACE, PAGE_IS_EMPTY, and palloc().
Referenced by gistPopItupFromNodeBuffer().
GISTNodeBuffer* gistGetNodeBuffer | ( | GISTBuildBuffers * | gfbb, |
GISTSTATE * | giststate, | ||
BlockNumber | nodeBlocknum, | ||
int | level | ||
) |
Definition at line 113 of file gistbuildbuffers.c.
References GISTNodeBuffer::blocksCount, GISTBuildBuffers::buffersOnLevels, GISTBuildBuffers::buffersOnLevelsLen, GISTBuildBuffers::context, HASH_ENTER, hash_search(), i, InvalidBlockNumber, GISTNodeBuffer::isTemp, lcons(), GISTNodeBuffer::level, MemoryContextSwitchTo(), NIL, GISTBuildBuffers::nodeBuffersTab, GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, GISTNodeBuffer::queuedForEmptying, and repalloc().
Referenced by gistProcessItup(), and gistRelocateBuildBuffersOnSplit().
GISTBuildBuffers* gistInitBuildBuffers | ( | int | pagesPerBuffer, |
int | levelStep, | ||
int | maxLevel | ||
) |
Definition at line 44 of file gistbuildbuffers.c.
References GISTBuildBuffers::bufferEmptyingQueue, GISTBuildBuffers::buffersOnLevels, GISTBuildBuffers::buffersOnLevelsLen, BufFileCreateTemp(), GISTBuildBuffers::context, CurrentMemoryContext, HASHCTL::entrysize, GISTBuildBuffers::freeBlocks, GISTBuildBuffers::freeBlocksLen, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASHCTL::hcxt, HASHCTL::keysize, GISTBuildBuffers::levelStep, GISTBuildBuffers::loadedBuffers, GISTBuildBuffers::loadedBuffersCount, GISTBuildBuffers::loadedBuffersLen, GISTBuildBuffers::nFileBlocks, GISTBuildBuffers::nFreeBlocks, NIL, GISTBuildBuffers::nodeBuffersTab, GISTBuildBuffers::pagesPerBuffer, palloc(), GISTBuildBuffers::pfile, and GISTBuildBuffers::rootlevel.
Referenced by gistInitBuffering().
|
static |
Definition at line 221 of file gistbuildbuffers.c.
References GISTNodeBuffer::blocksCount, gistAddLoadedBuffer(), gistAllocateNewPageBuffer(), gistBuffersReleaseBlock(), InvalidBlockNumber, GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, GISTBuildBuffers::pfile, and ReadTempFileBlock().
Referenced by gistPopItupFromNodeBuffer(), and gistPushItupToNodeBuffer().
|
static |
Definition at line 288 of file gistbuildbuffers.c.
References Assert, BUFFER_PAGE_DATA_OFFSET, IndexTupleSize, MAXALIGN, and PAGE_FREE_SPACE.
Referenced by gistPushItupToNodeBuffer().
bool gistPopItupFromNodeBuffer | ( | GISTBuildBuffers * | gfbb, |
GISTNodeBuffer * | nodeBuffer, | ||
IndexTuple * | itup | ||
) |
Definition at line 406 of file gistbuildbuffers.c.
References Assert, GISTNodeBuffer::blocksCount, gistBuffersReleaseBlock(), gistGetItupFromPage(), gistLoadNodeBuffer(), InvalidBlockNumber, PAGE_IS_EMPTY, GISTNodeBuffer::pageBuffer, GISTBuildBuffers::pfile, pfree(), GISTNodeBufferPage::prev, and ReadTempFileBlock().
Referenced by gistProcessEmptyingQueue(), and gistRelocateBuildBuffersOnSplit().
void gistPushItupToNodeBuffer | ( | GISTBuildBuffers * | gfbb, |
GISTNodeBuffer * | nodeBuffer, | ||
IndexTuple | itup | ||
) |
Definition at line 336 of file gistbuildbuffers.c.
References GISTNodeBuffer::blocksCount, BUFFER_HALF_FILLED, GISTBuildBuffers::bufferEmptyingQueue, GISTBuildBuffers::context, gistAddLoadedBuffer(), gistAllocateNewPageBuffer(), gistBuffersGetFreeBlock(), gistLoadNodeBuffer(), gistPlaceItupToPage(), lcons(), MAXALIGN, MemoryContextSwitchTo(), PAGE_FREE_SPACE, PAGE_NO_SPACE, GISTNodeBuffer::pageBuffer, GISTBuildBuffers::pfile, GISTNodeBufferPage::prev, GISTNodeBuffer::queuedForEmptying, and WriteTempFileBlock().
Referenced by gistProcessItup(), and gistRelocateBuildBuffersOnSplit().
void gistRelocateBuildBuffersOnSplit | ( | GISTBuildBuffers * | gfbb, |
GISTSTATE * | giststate, | ||
Relation | r, | ||
int | level, | ||
Buffer | buffer, | ||
List * | splitinfo | ||
) |
Definition at line 533 of file gistbuildbuffers.c.
References Assert, GISTNodeBuffer::blocksCount, GISTPageSplitInfo::buf, BufferGetBlockNumber(), GISTPageSplitInfo::downlink, RelocationBufferInfo::entry, foreach_current_index, GIST_ROOT_BLKNO, gistDeCompressAtt(), gistgetadjusted(), gistGetNodeBuffer(), gistpenalty(), gistPopItupFromNodeBuffer(), gistPushItupToNodeBuffer(), HASH_FIND, hash_search(), i, INDEX_MAX_KEYS, IndexRelationGetNumberOfKeyAttributes, InvalidBlockNumber, RelocationBufferInfo::isnull, GISTNodeBuffer::isTemp, j, LEVEL_HAS_BUFFERS, lfirst, list_length(), RelocationBufferInfo::nodeBuffer, GISTBuildBuffers::nodeBuffersTab, GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, palloc(), pfree(), and RelocationBufferInfo::splitinfo.
Referenced by gistbufferinginserttuples().
|
static |
Definition at line 246 of file gistbuildbuffers.c.
References gistBuffersGetFreeBlock(), GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, GISTBuildBuffers::pfile, pfree(), and WriteTempFileBlock().
Referenced by gistUnloadNodeBuffers().
void gistUnloadNodeBuffers | ( | GISTBuildBuffers * | gfbb | ) |
Definition at line 272 of file gistbuildbuffers.c.
References gistUnloadNodeBuffer(), i, GISTBuildBuffers::loadedBuffers, and GISTBuildBuffers::loadedBuffersCount.
Referenced by gistProcessEmptyingQueue().
|
static |
Definition at line 750 of file gistbuildbuffers.c.
References BufFileReadExact(), BufFileSeekBlock(), elog, and ERROR.
Referenced by gistLoadNodeBuffer(), and gistPopItupFromNodeBuffer().
|
static |
Definition at line 758 of file gistbuildbuffers.c.
References BufFileSeekBlock(), BufFileWrite(), elog, and ERROR.
Referenced by gistPushItupToNodeBuffer(), and gistUnloadNodeBuffer().