|
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 196 of file gistbuildbuffers.c.
References GISTNodeBuffer::isTemp, GISTBuildBuffers::loadedBuffers, GISTBuildBuffers::loadedBuffersCount, GISTBuildBuffers::loadedBuffersLen, and repalloc().
Referenced by gistLoadNodeBuffer(), and gistPushItupToNodeBuffer().
|
static |
Definition at line 179 of file gistbuildbuffers.c.
References BUFFER_PAGE_DATA_OFFSET, GISTBuildBuffers::context, fb(), InvalidBlockNumber, MemoryContextAllocZero(), PAGE_FREE_SPACE, and GISTNodeBufferPage::prev.
Referenced by gistLoadNodeBuffer(), and gistPushItupToNodeBuffer().
|
static |
Definition at line 466 of file gistbuildbuffers.c.
References GISTBuildBuffers::freeBlocks, GISTBuildBuffers::nFileBlocks, and GISTBuildBuffers::nFreeBlocks.
Referenced by gistPushItupToNodeBuffer(), and gistUnloadNodeBuffer().
|
static |
Definition at line 483 of file gistbuildbuffers.c.
References fb(), GISTBuildBuffers::freeBlocks, GISTBuildBuffers::freeBlocksLen, GISTBuildBuffers::nFreeBlocks, and repalloc().
Referenced by gistLoadNodeBuffer(), and gistPopItupFromNodeBuffer().
| void gistFreeBuildBuffers | ( | GISTBuildBuffers * | gfbb | ) |
Definition at line 505 of file gistbuildbuffers.c.
References BufFileClose(), and GISTBuildBuffers::pfile.
Referenced by gistbuild().
|
static |
Definition at line 309 of file gistbuildbuffers.c.
References Assert, BUFFER_PAGE_DATA_OFFSET, fb(), 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 111 of file gistbuildbuffers.c.
References GISTNodeBuffer::blocksCount, GISTBuildBuffers::buffersOnLevels, GISTBuildBuffers::buffersOnLevelsLen, GISTBuildBuffers::context, fb(), 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, fb(), GISTBuildBuffers::freeBlocks, GISTBuildBuffers::freeBlocksLen, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, GISTBuildBuffers::levelStep, GISTBuildBuffers::loadedBuffers, GISTBuildBuffers::loadedBuffersCount, GISTBuildBuffers::loadedBuffersLen, GISTBuildBuffers::nFileBlocks, GISTBuildBuffers::nFreeBlocks, NIL, GISTBuildBuffers::nodeBuffersTab, GISTBuildBuffers::pagesPerBuffer, palloc_array, palloc_object, GISTBuildBuffers::pfile, and GISTBuildBuffers::rootlevel.
Referenced by gistInitBuffering().
|
static |
Definition at line 219 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 286 of file gistbuildbuffers.c.
References Assert, BUFFER_PAGE_DATA_OFFSET, fb(), IndexTupleSize(), MAXALIGN, and PAGE_FREE_SPACE.
Referenced by gistPushItupToNodeBuffer().
| bool gistPopItupFromNodeBuffer | ( | GISTBuildBuffers * | gfbb, |
| GISTNodeBuffer * | nodeBuffer, | ||
| IndexTuple * | itup | ||
| ) |
Definition at line 404 of file gistbuildbuffers.c.
References Assert, GISTNodeBuffer::blocksCount, fb(), 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 334 of file gistbuildbuffers.c.
References GISTNodeBuffer::blocksCount, BUFFER_HALF_FILLED, GISTBuildBuffers::bufferEmptyingQueue, GISTBuildBuffers::context, fb(), 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 531 of file gistbuildbuffers.c.
References Assert, GISTNodeBuffer::blocksCount, BufferGetBlockNumber(), fb(), foreach_current_index, GIST_ROOT_BLKNO, gistDeCompressAtt(), gistgetadjusted(), gistGetNodeBuffer(), gistpenalty(), gistPopItupFromNodeBuffer(), gistPushItupToNodeBuffer(), HASH_FIND, hash_search(), i, INDEX_MAX_KEYS, IndexRelationGetNumberOfKeyAttributes, InvalidBlockNumber, j, LEVEL_HAS_BUFFERS, lfirst, list_length(), GISTBuildBuffers::nodeBuffersTab, GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, palloc_array, and pfree().
Referenced by gistbufferinginserttuples().
|
static |
Definition at line 244 of file gistbuildbuffers.c.
References fb(), gistBuffersGetFreeBlock(), GISTNodeBuffer::pageBlocknum, GISTNodeBuffer::pageBuffer, GISTBuildBuffers::pfile, pfree(), and WriteTempFileBlock().
Referenced by gistUnloadNodeBuffers().
| void gistUnloadNodeBuffers | ( | GISTBuildBuffers * | gfbb | ) |
Definition at line 270 of file gistbuildbuffers.c.
References gistUnloadNodeBuffer(), i, GISTBuildBuffers::loadedBuffers, and GISTBuildBuffers::loadedBuffersCount.
Referenced by gistProcessEmptyingQueue().
Definition at line 746 of file gistbuildbuffers.c.
References BufFileReadExact(), BufFileSeekBlock(), elog, ERROR, and fb().
Referenced by gistLoadNodeBuffer(), and gistPopItupFromNodeBuffer().
Definition at line 754 of file gistbuildbuffers.c.
References BufFileSeekBlock(), BufFileWrite(), elog, ERROR, and fb().
Referenced by gistPushItupToNodeBuffer(), and gistUnloadNodeBuffer().