PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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

void hash_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 20 of file hashdesc.c.

References appendStringInfo(), xl_hash_add_ovfl_page::bmpage_found, xl_hash_add_ovfl_page::bmsize, xl_hash_init_bitmap_page::bmsize, xl_hash_delete::clear_dead_marking, xl_hash_init_meta_page::ffactor, xl_hash_split_allocate_page::flags, 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_split_allocate_page::new_bucket, 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_complete::old_bucket_flag, xl_hash_squeeze_page::prevblkno, 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, XLogRecGetInfo, and XLR_INFO_MASK.

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, fillfactor %d",
32  xlrec->num_tuples, xlrec->ffactor);
33  break;
34  }
36  {
38 
39  appendStringInfo(buf, "bmsize %d", xlrec->bmsize);
40  break;
41  }
42  case XLOG_HASH_INSERT:
43  {
44  xl_hash_insert *xlrec = (xl_hash_insert *) rec;
45 
46  appendStringInfo(buf, "off %u", xlrec->offnum);
47  break;
48  }
50  {
52 
53  appendStringInfo(buf, "bmsize %d, bmpage_found %c",
54  xlrec->bmsize, (xlrec->bmpage_found) ? 'T' : 'F');
55  break;
56  }
58  {
60 
61  appendStringInfo(buf, "new_bucket %u, meta_page_masks_updated %c, issplitpoint_changed %c",
62  xlrec->new_bucket,
63  (xlrec->flags & XLH_SPLIT_META_UPDATE_MASKS) ? 'T' : 'F',
64  (xlrec->flags & XLH_SPLIT_META_UPDATE_SPLITPOINT) ? 'T' : 'F');
65  break;
66  }
68  {
70 
71  appendStringInfo(buf, "old_bucket_flag %u, new_bucket_flag %u",
72  xlrec->old_bucket_flag, xlrec->new_bucket_flag);
73  break;
74  }
76  {
78 
79  appendStringInfo(buf, "ntups %d, is_primary %c",
80  xlrec->ntups,
81  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
82  break;
83  }
85  {
87 
88  appendStringInfo(buf, "prevblkno %u, nextblkno %u, ntups %d, is_primary %c",
89  xlrec->prevblkno,
90  xlrec->nextblkno,
91  xlrec->ntups,
92  xlrec->is_prim_bucket_same_wrt ? 'T' : 'F');
93  break;
94  }
95  case XLOG_HASH_DELETE:
96  {
97  xl_hash_delete *xlrec = (xl_hash_delete *) rec;
98 
99  appendStringInfo(buf, "clear_dead_marking %c, is_primary %c",
100  xlrec->clear_dead_marking ? 'T' : 'F',
101  xlrec->is_primary_bucket_page ? 'T' : 'F');
102  break;
103  }
105  {
107 
108  appendStringInfo(buf, "ntuples %g",
109  xlrec->ntuples);
110  break;
111  }
113  {
115 
116  appendStringInfo(buf, "ntuples %d",
117  xlrec->ntuples);
118  break;
119  }
120  }
121 }
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
#define XLH_SPLIT_META_UPDATE_SPLITPOINT
Definition: hash_xlog.h:54
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
unsigned char uint8
Definition: c.h:266
bool clear_dead_marking
Definition: hash_xlog.h:201
BlockNumber prevblkno
Definition: hash_xlog.h:176
bool is_prim_bucket_same_wrt
Definition: hash_xlog.h:179
#define XLogRecGetData(decoder)
Definition: xlogreader.h:220
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
BlockNumber nextblkno
Definition: hash_xlog.h:177
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
bool is_primary_bucket_page
Definition: hash_xlog.h:203
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:40
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:216
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:35
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:47
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
OffsetNumber offnum
Definition: hash_xlog.h:79
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:37
#define XLH_SPLIT_META_UPDATE_MASKS
Definition: hash_xlog.h:53
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:44
const char* hash_identify ( uint8  info)

Definition at line 124 of file hashdesc.c.

References NULL, 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.

125 {
126  const char *id = NULL;
127 
128  switch (info & ~XLR_INFO_MASK)
129  {
131  id = "INIT_META_PAGE";
132  break;
134  id = "INIT_BITMAP_PAGE";
135  break;
136  case XLOG_HASH_INSERT:
137  id = "INSERT";
138  break;
140  id = "ADD_OVFL_PAGE";
141  break;
143  id = "SPLIT_ALLOCATE_PAGE";
144  break;
146  id = "SPLIT_PAGE";
147  break;
149  id = "SPLIT_COMPLETE";
150  break;
152  id = "MOVE_PAGE_CONTENTS";
153  break;
155  id = "SQUEEZE_PAGE";
156  break;
157  case XLOG_HASH_DELETE:
158  id = "DELETE";
159  break;
161  id = "SPLIT_CLEANUP";
162  break;
164  id = "UPDATE_META_PAGE";
165  break;
167  id = "VACUUM_ONE_PAGE";
168  }
169 
170  return id;
171 }
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
#define XLOG_HASH_INIT_BITMAP_PAGE
Definition: hash_xlog.h:28
#define XLOG_HASH_SPLIT_CLEANUP
Definition: hash_xlog.h:41
#define XLOG_HASH_SPLIT_PAGE
Definition: hash_xlog.h:32
#define XLOG_HASH_ADD_OVFL_PAGE
Definition: hash_xlog.h:30
#define XLOG_HASH_DELETE
Definition: hash_xlog.h:40
#define XLOG_HASH_INIT_META_PAGE
Definition: hash_xlog.h:27
#define XLOG_HASH_MOVE_PAGE_CONTENTS
Definition: hash_xlog.h:35
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:47
#define NULL
Definition: c.h:229
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_HASH_SPLIT_COMPLETE
Definition: hash_xlog.h:33
#define XLOG_HASH_SPLIT_ALLOCATE_PAGE
Definition: hash_xlog.h:31
#define XLOG_HASH_SQUEEZE_PAGE
Definition: hash_xlog.h:37
#define XLOG_HASH_UPDATE_META_PAGE
Definition: hash_xlog.h:44