| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef HASH_XLOG_H |
| #define HASH_XLOG_H |
|
|
| #include "access/xlogreader.h" |
| #include "lib/stringinfo.h" |
| #include "storage/off.h" |
|
|
| |
| #define HASH_XLOG_FREE_OVFL_BUFS 6 |
|
|
| |
| |
| |
| #define XLOG_HASH_INIT_META_PAGE 0x00 |
| #define XLOG_HASH_INIT_BITMAP_PAGE 0x10 |
| #define XLOG_HASH_INSERT 0x20 |
| #define XLOG_HASH_ADD_OVFL_PAGE 0x30 |
| #define XLOG_HASH_SPLIT_ALLOCATE_PAGE 0x40 |
| #define XLOG_HASH_SPLIT_PAGE 0x50 |
| #define XLOG_HASH_SPLIT_COMPLETE 0x60 |
| #define XLOG_HASH_MOVE_PAGE_CONTENTS 0x70 |
| |
| #define XLOG_HASH_SQUEEZE_PAGE 0x80 |
| |
| |
| #define XLOG_HASH_DELETE 0x90 |
| #define XLOG_HASH_SPLIT_CLEANUP 0xA0 |
| |
| |
| #define XLOG_HASH_UPDATE_META_PAGE 0xB0 |
|
|
| #define XLOG_HASH_VACUUM_ONE_PAGE 0xC0 |
| |
|
|
| |
| |
| |
| #define XLH_SPLIT_META_UPDATE_MASKS (1<<0) |
| #define XLH_SPLIT_META_UPDATE_SPLITPOINT (1<<1) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_insert |
| { |
| OffsetNumber offnum; |
| } xl_hash_insert; |
|
|
| #define SizeOfHashInsert (offsetof(xl_hash_insert, offnum) + sizeof(OffsetNumber)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_add_ovfl_page |
| { |
| uint16 bmsize; |
| bool bmpage_found; |
| } xl_hash_add_ovfl_page; |
|
|
| #define SizeOfHashAddOvflPage \ |
| (offsetof(xl_hash_add_ovfl_page, bmpage_found) + sizeof(bool)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_split_allocate_page |
| { |
| uint32 new_bucket; |
| uint16 old_bucket_flag; |
| uint16 new_bucket_flag; |
| uint8 flags; |
| } xl_hash_split_allocate_page; |
|
|
| #define SizeOfHashSplitAllocPage \ |
| (offsetof(xl_hash_split_allocate_page, flags) + sizeof(uint8)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_split_complete |
| { |
| uint16 old_bucket_flag; |
| uint16 new_bucket_flag; |
| } xl_hash_split_complete; |
|
|
| #define SizeOfHashSplitComplete \ |
| (offsetof(xl_hash_split_complete, new_bucket_flag) + sizeof(uint16)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_move_page_contents |
| { |
| uint16 ntups; |
| bool is_prim_bucket_same_wrt; |
| |
| |
| } xl_hash_move_page_contents; |
|
|
| #define SizeOfHashMovePageContents \ |
| (offsetof(xl_hash_move_page_contents, is_prim_bucket_same_wrt) + sizeof(bool)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_squeeze_page |
| { |
| BlockNumber prevblkno; |
| BlockNumber nextblkno; |
| uint16 ntups; |
| bool is_prim_bucket_same_wrt; |
| |
| |
| bool is_prev_bucket_same_wrt; |
| |
| |
| |
| } xl_hash_squeeze_page; |
|
|
| #define SizeOfHashSqueezePage \ |
| (offsetof(xl_hash_squeeze_page, is_prev_bucket_same_wrt) + sizeof(bool)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_delete |
| { |
| bool clear_dead_marking; |
| |
| bool is_primary_bucket_page; |
| |
| } xl_hash_delete; |
|
|
| #define SizeOfHashDelete (offsetof(xl_hash_delete, is_primary_bucket_page) + sizeof(bool)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_update_meta_page |
| { |
| double ntuples; |
| } xl_hash_update_meta_page; |
|
|
| #define SizeOfHashUpdateMetaPage \ |
| (offsetof(xl_hash_update_meta_page, ntuples) + sizeof(double)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_init_meta_page |
| { |
| double num_tuples; |
| RegProcedure procid; |
| uint16 ffactor; |
| } xl_hash_init_meta_page; |
|
|
| #define SizeOfHashInitMetaPage \ |
| (offsetof(xl_hash_init_meta_page, ffactor) + sizeof(uint16)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_init_bitmap_page |
| { |
| uint16 bmsize; |
| } xl_hash_init_bitmap_page; |
|
|
| #define SizeOfHashInitBitmapPage \ |
| (offsetof(xl_hash_init_bitmap_page, bmsize) + sizeof(uint16)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct xl_hash_vacuum_one_page |
| { |
| TransactionId snapshotConflictHorizon; |
| uint16 ntuples; |
| bool isCatalogRel; |
| |
|
|
| |
| OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER]; |
| } xl_hash_vacuum_one_page; |
|
|
| #define SizeOfHashVacuumOnePage offsetof(xl_hash_vacuum_one_page, offsets) |
|
|
| extern void hash_redo(XLogReaderState *record); |
| extern void hash_desc(StringInfo buf, XLogReaderState *record); |
| extern const char *hash_identify(uint8 info); |
| extern void hash_mask(char *pagedata, BlockNumber blkno); |
|
|
| #endif |
|
|