Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Value representing an invalid LSN (used in error conditions) InvalidLSN = LSN(math.MaxUint64) // WALPageSize == PostgreSQL's Page Size. Page Size == BLKSZ WALPageSize // defaults to 8KB. The same value used in the WAL is used in the PostgreSQL // Heap. // // TODO(seanc@): pull this data from `SHOW wal_block_size`. WALPageSize = 8 * units.KiB HeapPageSize = WALPageSize // WALFileSize == PostgreSQL WAL File Size. // WALFileSize defaults to 16MB // // TODO(seanc@): pull this value from `SHOW wal_segment_size` WALFileSize = 16 * units.MiB // HeapMaxSegmentSize is the max size of a single file in a relation. // // TODO(seanc@): pull this value from pg_controldata(1)'s "Blocks per segment // of large relation" and multiply it by WALBlockSize HeapMaxSegmentSize = 1 * units.GiB WALFilesPerSegment uint64 = 0x100000000 / uint64(WALFileSize) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeapBlockNumber ¶
type HeapBlockNumber uint64
HeapBlockNumber represents a given HeapBlockNumber inside of a segment
type HeapPageNumber ¶
type HeapPageNumber uint64
func HeapSegmentPageNum ¶
func HeapSegmentPageNum(block HeapBlockNumber) HeapPageNumber
HeapSegmentPageNum returns the page number of a given page inside of a heap segment.
type HeapSegment ¶
type HeapSegment uint32
func SegmentNumber ¶
func SegmentNumber(block uint64) HeapSegment
SegmentNumber returns the segment number from a given block number.
type LSN ¶
type LSN uint64
func New ¶
func New(segNo HeapSegment, off Offset) LSN
New creates a new LSN from a segment ID and offset
func (LSN) ByteOffset ¶
Offset returns the byte offset inside of a WAL segment.
func (LSN) SegmentNumber ¶
func (lsn LSN) SegmentNumber() HeapSegment
Segment returns the Segment number of the LSN.
func (LSN) WALFileName ¶
func (lsn LSN) WALFileName(timelineID ...TimelineID) string
WALFileName returns the name of a WAL's filename. The timeline number is optional. If the timeline is not specified, default to a timelineID of 1.
type TimelineID ¶
type TimelineID uint32
Click to show internal directories.
Click to hide internal directories.