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 61 of file gistdesc.c.

References out_gistxlogDelete(), out_gistxlogPageDelete(), out_gistxlogPageReuse(), out_gistxlogPageSplit(), out_gistxlogPageUpdate(), 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.

62 {
63  char *rec = XLogRecGetData(record);
64  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
65 
66  switch (info)
67  {
70  break;
73  break;
74  case XLOG_GIST_DELETE:
75  out_gistxlogDelete(buf, (gistxlogDelete *) rec);
76  break;
79  break;
82  break;
83  }
84 }
static void out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
Definition: gistdesc.c:45
unsigned char uint8
Definition: c.h:357
static void out_gistxlogDelete(StringInfo buf, gistxlogDelete *xlrec)
Definition: gistdesc.c:37
#define XLogRecGetData(decoder)
Definition: xlogreader.h:283
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:25
static void out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
Definition: gistdesc.c:22
static void out_gistxlogPageReuse(StringInfo buf, gistxlogPageReuse *xlrec)
Definition: gistdesc.c:27
#define XLOG_GIST_DELETE
Definition: gistxlog.h:21
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:279
#define XLOG_GIST_PAGE_REUSE
Definition: gistxlog.h:23
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_GIST_PAGE_DELETE
Definition: gistxlog.h:28
static void out_gistxlogPageDelete(StringInfo buf, gistxlogPageDelete *xlrec)
Definition: gistdesc.c:52
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20

◆ gist_identify()

const char* gist_identify ( uint8  info)

Definition at line 87 of file gistdesc.c.

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

88 {
89  const char *id = NULL;
90 
91  switch (info & ~XLR_INFO_MASK)
92  {
94  id = "PAGE_UPDATE";
95  break;
96  case XLOG_GIST_DELETE:
97  id = "DELETE";
98  break;
100  id = "PAGE_REUSE";
101  break;
103  id = "PAGE_SPLIT";
104  break;
106  id = "PAGE_DELETE";
107  break;
108  }
109 
110  return id;
111 }
#define XLOG_GIST_PAGE_SPLIT
Definition: gistxlog.h:25
#define XLOG_GIST_DELETE
Definition: gistxlog.h:21
#define XLOG_GIST_PAGE_REUSE
Definition: gistxlog.h:23
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define XLOG_GIST_PAGE_DELETE
Definition: gistxlog.h:28
#define XLOG_GIST_PAGE_UPDATE
Definition: gistxlog.h:20

◆ out_gistxlogDelete()

static void out_gistxlogDelete ( StringInfo  buf,
gistxlogDelete xlrec 
)
static

Definition at line 37 of file gistdesc.c.

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

Referenced by gist_desc().

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

◆ out_gistxlogPageDelete()

static void out_gistxlogPageDelete ( StringInfo  buf,
gistxlogPageDelete xlrec 
)
static

Definition at line 52 of file gistdesc.c.

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

Referenced by gist_desc().

53 {
54  appendStringInfo(buf, "deleteXid %u:%u; downlink %u",
57  xlrec->downlinkOffset);
58 }
#define XidFromFullTransactionId(x)
Definition: transam.h:48
FullTransactionId deleteXid
Definition: gistxlog.h:86
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
#define EpochFromFullTransactionId(x)
Definition: transam.h:47
OffsetNumber downlinkOffset
Definition: gistxlog.h:87

◆ out_gistxlogPageReuse()

static void out_gistxlogPageReuse ( StringInfo  buf,
gistxlogPageReuse xlrec 
)
static

Definition at line 27 of file gistdesc.c.

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

Referenced by gist_desc().

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:100
RelFileNode node
Definition: gistxlog.h:99
#define XidFromFullTransactionId(x)
Definition: transam.h:48
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
#define EpochFromFullTransactionId(x)
Definition: transam.h:47
FullTransactionId latestRemovedFullXid
Definition: gistxlog.h:101

◆ out_gistxlogPageSplit()

static void out_gistxlogPageSplit ( StringInfo  buf,
gistxlogPageSplit xlrec 
)
static

Definition at line 45 of file gistdesc.c.

References appendStringInfo(), and gistxlogPageSplit::npage.

Referenced by gist_desc().

46 {
47  appendStringInfo(buf, "page_split: splits to %d pages",
48  xlrec->npage);
49 }
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91

◆ out_gistxlogPageUpdate()

static void out_gistxlogPageUpdate ( StringInfo  buf,
gistxlogPageUpdate xlrec 
)
static

Definition at line 22 of file gistdesc.c.

Referenced by gist_desc().

23 {
24 }