PostgreSQL Source Code git master
hashdesc.c File Reference
#include "postgres.h"
#include "access/hash_xlog.h"
Include dependency graph for hashdesc.c:

Go to the source code of this file.

Functions

void hash_desc (StringInfo buf, XLogReaderState *record)
 
const char * hash_identify (uint8 info)
 

Function Documentation

◆ hash_desc()

void hash_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 20 of file hashdesc.c.

21{
22 char *rec = XLogRecGetData(record);
23 uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
24
25 switch (info)
26 {
28 {
30
31 appendStringInfo(buf, "num_tuples %g, procid %u, fillfactor %d",
32 xlrec->num_tuples,
33 xlrec->procid,
34 xlrec->ffactor);
35 break;
36 }
38 {
40
41 appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
42 break;
43 }
45 {
46 xl_hash_insert *xlrec = (xl_hash_insert *) rec;
47
48 appendStringInfo(buf, "off %u", xlrec->offnum);
49 break;
50 }
52 {
54
55 appendStringInfo(buf, "bmsize %d, bmpage_found %c",
56 xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
57 break;
58 }
60 {
62
63 appendStringInfo(buf, "new_bucket %u, old_bucket_flag %u, new_bucket_flag %u, meta_page_masks_updated %c, issplitpoint_changed %c",
64 xlrec->new_bucket,
65 xlrec->old_bucket_flag,
66 xlrec->new_bucket_flag,
67 (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
68 (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
69 break;
70 }
72 {
74
75 appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
76 xlrec->old_bucket_flag, xlrec->new_bucket_flag);
77 break;
78 }
80 {
82
83 appendStringInfo(buf, "ntups %d, is_primary %c",
84 xlrec->ntups,
85 xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
86 break;
87 }
89 {
91
92 appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c, is_previous %c",
93 xlrec->prevblkno,
94 xlrec->nextblkno,
95 xlrec->ntups,
96 xlrec->is_prim_bucket_same_wrt ? 'T' : 'F',
97 xlrec->is_prev_bucket_same_wrt ? 'T' : 'F');
98 break;
99 }
100 case XLOG_HASH_DELETE:
101 {
102 xl_hash_delete *xlrec = (xl_hash_delete *) rec;
103
104 appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
105 xlrec->clear_dead_marking ? 'T' : 'F',
106 xlrec->is_primary_bucket_page ? 'T' : 'F');
107 break;
108 }
110 {
112
113 appendStringInfo(buf, "ntuples %g",
114 xlrec->ntuples);
115 break;
116 }
118 {
120
121 appendStringInfo(buf, "ntuples %d, snapshotConflictHorizon %u, isCatalogRel %c",
122 xlrec->ntuples,
124 xlrec->isCatalogRel ? 'T' : 'F');
125 break;
126 }
127 }
128}
uint8_t uint8
Definition: c.h:539
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:35
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:38
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:36
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLH_SPLIT_META_UPDATE_SPLITPOINT
Definition: hash_xlog.h:46
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:34
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:40
#define XLH_SPLIT_META_UPDATE_MASKS
Definition: hash_xlog.h:45
static char * buf
Definition: pg_test_fsync.c:72
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:145
bool clear_dead_marking
Definition: hash_xlog.h:181
bool is_primary_bucket_page
Definition: hash_xlog.h:183
RegProcedure procid
Definition: hash_xlog.h:214
OffsetNumber offnum
Definition: hash_xlog.h:58
BlockNumber prevblkno
Definition: hash_xlog.h:156
bool is_prim_bucket_same_wrt
Definition: hash_xlog.h:159
bool is_prev_bucket_same_wrt
Definition: hash_xlog.h:162
BlockNumber nextblkno
Definition: hash_xlog.h:157
TransactionId snapshotConflictHorizon
Definition: hash_xlog.h:248
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:409
#define XLogRecGetData(decoder)
Definition: xlogreader.h:414

References appendStringInfo(), xl_hash_add_ovfl_page::bmpage_found, xl_hash_add_ovfl_page::bmsize, xl_hash_init_bitmap_page::bmsize, buf, xl_hash_delete::clear_dead_marking, xl_hash_init_meta_page::ffactor, xl_hash_split_allocate_page::flags, xl_hash_squeeze_page::is_prev_bucket_same_wrt, xl_hash_move_page_contents::is_prim_bucket_same_wrt, xl_hash_squeeze_page::is_prim_bucket_same_wrt, xl_hash_delete::is_primary_bucket_page, xl_hash_vacuum_one_page::isCatalogRel, xl_hash_split_allocate_page::new_bucket, xl_hash_split_allocate_page::new_bucket_flag, xl_hash_split_complete::new_bucket_flag, xl_hash_squeeze_page::nextblkno, xl_hash_update_meta_page::ntuples, xl_hash_vacuum_one_page::ntuples, xl_hash_move_page_contents::ntups, xl_hash_squeeze_page::ntups, xl_hash_init_meta_page::num_tuples, xl_hash_insert::offnum, xl_hash_split_allocate_page::old_bucket_flag, xl_hash_split_complete::old_bucket_flag, xl_hash_squeeze_page::prevblkno, xl_hash_init_meta_page::procid, xl_hash_vacuum_one_page::snapshotConflictHorizon, XLH_SPLIT_META_UPDATE_MASKS, XLH_SPLIT_META_UPDATE_SPLITPOINT, XLOG_HASH_ADD_OVFL_PAGE, XLOG_HASH_DELETE, XLOG_HASH_INIT_BITMAP_PAGE, XLOG_HASH_INIT_META_PAGE, XLOG_HASH_INSERT, XLOG_HASH_MOVE_PAGE_CONTENTS, XLOG_HASH_SPLIT_ALLOCATE_PAGE, XLOG_HASH_SPLIT_COMPLETE, XLOG_HASH_SQUEEZE_PAGE, XLOG_HASH_UPDATE_META_PAGE, XLOG_HASH_VACUUM_ONE_PAGE, XLogRecGetData, and XLogRecGetInfo.

◆ hash_identify()

const char * hash_identify ( uint8  info)

Definition at line 131 of file hashdesc.c.

132{
133 const char *id = NULL;
134
135 switch (info & ~XLR_INFO_MASK)
136 {
138 id = "INIT_META_PAGE";
139 break;
141 id = "INIT_BITMAP_PAGE";
142 break;
143 case XLOG_HASH_INSERT:
144 id = "INSERT";
145 break;
147 id = "ADD_OVFL_PAGE";
148 break;
150 id = "SPLIT_ALLOCATE_PAGE";
151 break;
153 id = "SPLIT_PAGE";
154 break;
156 id = "SPLIT_COMPLETE";
157 break;
159 id = "MOVE_PAGE_CONTENTS";
160 break;
162 id = "SQUEEZE_PAGE";
163 break;
164 case XLOG_HASH_DELETE:
165 id = "DELETE";
166 break;
168 id = "SPLIT_CLEANUP";
169 break;
171 id = "UPDATE_META_PAGE";
172 break;
174 id = "VACUUM_ONE_PAGE";
175 }
176
177 return id;
178}
#define XLOG_HASH_SPLIT_CLEANUP
Definition: hash_xlog.h:37
#define XLOG_HASH_SPLIT_PAGE
Definition: hash_xlog.h:32
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

References XLOG_HASH_ADD_OVFL_PAGE, XLOG_HASH_DELETE, XLOG_HASH_INIT_BITMAP_PAGE, XLOG_HASH_INIT_META_PAGE, XLOG_HASH_INSERT, XLOG_HASH_MOVE_PAGE_CONTENTS, XLOG_HASH_SPLIT_ALLOCATE_PAGE, XLOG_HASH_SPLIT_CLEANUP, XLOG_HASH_SPLIT_COMPLETE, XLOG_HASH_SPLIT_PAGE, XLOG_HASH_SQUEEZE_PAGE, XLOG_HASH_UPDATE_META_PAGE, XLOG_HASH_VACUUM_ONE_PAGE, and XLR_INFO_MASK.