PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/xloginsert.h"
#include "access/xlogrecord.h"
#include "storage/bufpage.h"
#include "storage/bulk_write.h"
#include "storage/proc.h"
#include "storage/smgr.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | PendingWrite |
struct | BulkWriteState |
Macros | |
#define | MAX_PENDING_WRITES XLR_MAX_BLOCK_ID |
Typedefs | |
typedef struct PendingWrite | PendingWrite |
Functions | |
static void | smgr_bulk_flush (BulkWriteState *bulkstate) |
BulkWriteState * | smgr_bulk_start_rel (Relation rel, ForkNumber forknum) |
BulkWriteState * | smgr_bulk_start_smgr (SMgrRelation smgr, ForkNumber forknum, bool use_wal) |
void | smgr_bulk_finish (BulkWriteState *bulkstate) |
static int | buffer_cmp (const void *a, const void *b) |
void | smgr_bulk_write (BulkWriteState *bulkstate, BlockNumber blocknum, BulkWriteBuffer buf, bool page_std) |
BulkWriteBuffer | smgr_bulk_get_buf (BulkWriteState *bulkstate) |
Variables | |
static const PGIOAlignedBlock | zero_buffer = {{0}} |
#define MAX_PENDING_WRITES XLR_MAX_BLOCK_ID |
Definition at line 45 of file bulk_write.c.
typedef struct PendingWrite PendingWrite |
|
static |
Definition at line 223 of file bulk_write.c.
References a, Assert, b, and PendingWrite::blkno.
Referenced by smgr_bulk_flush().
void smgr_bulk_finish | ( | BulkWriteState * | bulkstate | ) |
Definition at line 128 of file bulk_write.c.
References Assert, DEBUG1, DELAY_CHKPT_START, PGPROC::delayChkptFlags, elog, BulkWriteState::forknum, GetRedoRecPtr(), MyProc, BulkWriteState::smgr, smgr_bulk_flush(), smgrimmedsync(), SmgrIsTemp, smgrregistersync(), BulkWriteState::start_RedoRecPtr, and BulkWriteState::use_wal.
Referenced by _bt_load(), btbuildempty(), end_heap_rewrite(), gist_indexsortbuild(), RelationCopyStorage(), and spgbuildempty().
|
static |
Definition at line 240 of file bulk_write.c.
References PendingWrite::blkno, PendingWrite::buf, buffer_cmp(), PGIOAlignedBlock::data, BulkWriteState::forknum, i, RelFileLocatorBackend::locator, log_newpages(), MAX_PENDING_WRITES, BulkWriteState::npending, BulkWriteState::pages_written, PageSetChecksumInplace(), BulkWriteState::pending_writes, pfree(), qsort, BulkWriteState::smgr, SMgrRelationData::smgr_rlocator, smgrextend(), smgrwrite(), BulkWriteState::use_wal, and zero_buffer.
Referenced by smgr_bulk_finish(), and smgr_bulk_write().
BulkWriteBuffer smgr_bulk_get_buf | ( | BulkWriteState * | bulkstate | ) |
Definition at line 344 of file bulk_write.c.
References BulkWriteState::memcxt, MemoryContextAllocAligned(), and PG_IO_ALIGN_SIZE.
Referenced by _bt_blnewpage(), _bt_uppershutdown(), btbuildempty(), gist_indexsortbuild(), gist_indexsortbuild_levelstate_flush(), raw_heap_insert(), RelationCopyStorage(), and spgbuildempty().
BulkWriteState* smgr_bulk_start_rel | ( | Relation | rel, |
ForkNumber | forknum | ||
) |
Definition at line 85 of file bulk_write.c.
References INIT_FORKNUM, RelationGetSmgr(), RelationNeedsWAL, and smgr_bulk_start_smgr().
Referenced by _bt_load(), begin_heap_rewrite(), btbuildempty(), gist_indexsortbuild(), and spgbuildempty().
BulkWriteState* smgr_bulk_start_smgr | ( | SMgrRelation | smgr, |
ForkNumber | forknum, | ||
bool | use_wal | ||
) |
Definition at line 98 of file bulk_write.c.
References CurrentMemoryContext, GetRedoRecPtr(), and palloc().
Referenced by RelationCopyStorage(), and smgr_bulk_start_rel().
void smgr_bulk_write | ( | BulkWriteState * | bulkstate, |
BlockNumber | blocknum, | ||
BulkWriteBuffer | buf, | ||
bool | page_std | ||
) |
Definition at line 320 of file bulk_write.c.
References PendingWrite::blkno, PendingWrite::buf, buf, MAX_PENDING_WRITES, BulkWriteState::npending, PendingWrite::page_std, BulkWriteState::pending_writes, and smgr_bulk_flush().
Referenced by _bt_blwritepage(), btbuildempty(), end_heap_rewrite(), gist_indexsortbuild(), gist_indexsortbuild_levelstate_flush(), raw_heap_insert(), RelationCopyStorage(), and spgbuildempty().
|
static |
Definition at line 47 of file bulk_write.c.
Referenced by smgr_bulk_flush().