PostgreSQL Source Code  git master
gistdesc.c File Reference
#include "postgres.h"
#include "access/gistxlog.h"
#include "lib/stringinfo.h"
#include "storage/relfilenode.h"
Include dependency graph for gistdesc.c:

Go to the source code of this file.

Functions

static void out_gistxlogPageUpdate (StringInfo buf, gistxlogPageUpdate *xlrec)
 
static void out_gistxlogPageReuse (StringInfo buf, gistxlogPageReuse *xlrec)
 
static void out_gistxlogDelete (StringInfo buf, gistxlogDelete *xlrec)
 
static void out_gistxlogPageSplit (StringInfo buf, gistxlogPageSplit *xlrec)
 
static void out_gistxlogPageDelete (StringInfo buf, gistxlogPageDelete *xlrec)
 
void gist_desc (StringInfo buf, XLogReaderState *record)
 
const char * gist_identify (uint8 info)
 

Function Documentation

◆ gist_desc()

void gist_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 60 of file gistdesc.c.

61 {
62  char *rec = XLogRecGetData(record);
63  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
64 
65  switch (info)
66  {
69  break;
72  break;
73  case XLOG_GIST_DELETE:
75  break;
78  break;
81  break;
83  /* No details to write out */
84  break;
85  }
86 }
unsigned char uint8
Definition: c.h:439
static void out_gistxlogPageDelete(StringInfo buf, gistxlogPageDelete *xlrec)
Definition: gistdesc.c:51
static void out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
Definition: gistdesc.c:22
static void out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
Definition: gistdesc.c:44
static void out_gistxlogDelete(StringInfo buf, gistxlogDelete *xlrec)
Definition: gistdesc.c:37
static void out_gistxlogPageReuse(StringInfo buf, gistxlogPageReuse *xlrec)
Definition: gistdesc.c:27
#define XLOG_GIST_ASSIGN_LSN
Definition: gistxlog.h:27
#define XLOG_GIST_PAGE_REUSE
Definition: gistxlog.h:22
#define XLOG_GIST_PAGE_DELETE
Definition: gistxlog.h:26
#define XLOG_GIST_DELETE
Definition: gistxlog.h:21
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:23
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20
static char * buf
Definition: pg_test_fsync.c:67
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:408
#define XLogRecGetData(decoder)
Definition: xlogreader.h:413
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

References buf, out_gistxlogDelete(), out_gistxlogPageDelete(), out_gistxlogPageReuse(), out_gistxlogPageSplit(), out_gistxlogPageUpdate(), XLOG_GIST_ASSIGN_LSN, XLOG_GIST_DELETE, XLOG_GIST_PAGE_DELETE, XLOG_GIST_PAGE_REUSE, XLOG_GIST_PAGE_SPLIT, XLOG_GIST_PAGE_UPDATE, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

◆ gist_identify()

const char* gist_identify ( uint8  info)

Definition at line 89 of file gistdesc.c.

90 {
91  const char *id = NULL;
92 
93  switch (info & ~XLR_INFO_MASK)
94  {
96  id = "PAGE_UPDATE";
97  break;
98  case XLOG_GIST_DELETE:
99  id = "DELETE";
100  break;
102  id = "PAGE_REUSE";
103  break;
105  id = "PAGE_SPLIT";
106  break;
108  id = "PAGE_DELETE";
109  break;
111  id = "ASSIGN_LSN";
112  break;
113  }
114 
115  return id;
116 }

References XLOG_GIST_ASSIGN_LSN, XLOG_GIST_DELETE, XLOG_GIST_PAGE_DELETE, XLOG_GIST_PAGE_REUSE, XLOG_GIST_PAGE_SPLIT, XLOG_GIST_PAGE_UPDATE, and XLR_INFO_MASK.

◆ out_gistxlogDelete()

static void out_gistxlogDelete ( StringInfo  buf,
gistxlogDelete xlrec 
)
static

Definition at line 37 of file gistdesc.c.

38 {
39  appendStringInfo(buf, "delete: latestRemovedXid %u, nitems: %u",
40  xlrec->latestRemovedXid, xlrec->ntodelete);
41 }
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
TransactionId latestRemovedXid
Definition: gistxlog.h:50
uint16 ntodelete
Definition: gistxlog.h:51

References appendStringInfo(), buf, gistxlogDelete::latestRemovedXid, and gistxlogDelete::ntodelete.

Referenced by gist_desc().

◆ out_gistxlogPageDelete()

static void out_gistxlogPageDelete ( StringInfo  buf,
gistxlogPageDelete xlrec 
)
static

Definition at line 51 of file gistdesc.c.

52 {
53  appendStringInfo(buf, "deleteXid %u:%u; downlink %u",
56  xlrec->downlinkOffset);
57 }
FullTransactionId deleteXid
Definition: gistxlog.h:85
OffsetNumber downlinkOffset
Definition: gistxlog.h:86
#define EpochFromFullTransactionId(x)
Definition: transam.h:47
#define XidFromFullTransactionId(x)
Definition: transam.h:48

References appendStringInfo(), buf, gistxlogPageDelete::deleteXid, gistxlogPageDelete::downlinkOffset, EpochFromFullTransactionId, and XidFromFullTransactionId.

Referenced by gist_desc().

◆ out_gistxlogPageReuse()

static void out_gistxlogPageReuse ( StringInfo  buf,
gistxlogPageReuse xlrec 
)
static

Definition at line 27 of file gistdesc.c.

28 {
29  appendStringInfo(buf, "rel %u/%u/%u; blk %u; latestRemovedXid %u:%u",
30  xlrec->node.spcNode, xlrec->node.dbNode,
31  xlrec->node.relNode, xlrec->block,
34 }
BlockNumber block
Definition: gistxlog.h:99
RelFileNode node
Definition: gistxlog.h:98
FullTransactionId latestRemovedFullXid
Definition: gistxlog.h:100

References appendStringInfo(), gistxlogPageReuse::block, buf, RelFileNode::dbNode, EpochFromFullTransactionId, gistxlogPageReuse::latestRemovedFullXid, gistxlogPageReuse::node, RelFileNode::relNode, RelFileNode::spcNode, and XidFromFullTransactionId.

Referenced by gist_desc().

◆ out_gistxlogPageSplit()

static void out_gistxlogPageSplit ( StringInfo  buf,
gistxlogPageSplit xlrec 
)
static

Definition at line 44 of file gistdesc.c.

45 {
46  appendStringInfo(buf, "page_split: splits to %d pages",
47  xlrec->npage);
48 }

References appendStringInfo(), buf, and gistxlogPageSplit::npage.

Referenced by gist_desc().

◆ out_gistxlogPageUpdate()

static void out_gistxlogPageUpdate ( StringInfo  buf,
gistxlogPageUpdate xlrec 
)
static

Definition at line 22 of file gistdesc.c.

23 {
24 }

Referenced by gist_desc().