PostgreSQL Source Code  git master
gistdesc.c File Reference
#include "postgres.h"
#include "access/gistxlog.h"
#include "lib/stringinfo.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.

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:
76  break;
79  break;
82  break;
84  /* No details to write out */
85  break;
86  }
87 }
uint8_t uint8
Definition: c.h:483
static void out_gistxlogPageDelete(StringInfo buf, gistxlogPageDelete *xlrec)
Definition: gistdesc.c:52
static void out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
Definition: gistdesc.c:21
static void out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
Definition: gistdesc.c:45
static void out_gistxlogDelete(StringInfo buf, gistxlogDelete *xlrec)
Definition: gistdesc.c:37
static void out_gistxlogPageReuse(StringInfo buf, gistxlogPageReuse *xlrec)
Definition: gistdesc.c:26
#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:72
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:410
#define XLogRecGetData(decoder)
Definition: xlogreader.h:415
#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 90 of file gistdesc.c.

91 {
92  const char *id = NULL;
93 
94  switch (info & ~XLR_INFO_MASK)
95  {
97  id = "PAGE_UPDATE";
98  break;
99  case XLOG_GIST_DELETE:
100  id = "DELETE";
101  break;
103  id = "PAGE_REUSE";
104  break;
106  id = "PAGE_SPLIT";
107  break;
109  id = "PAGE_DELETE";
110  break;
112  id = "ASSIGN_LSN";
113  break;
114  }
115 
116  return id;
117 }

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: snapshotConflictHorizon %u, nitems: %u, isCatalogRel %c",
40  xlrec->snapshotConflictHorizon, xlrec->ntodelete,
41  xlrec->isCatalogRel ? 'T' : 'F');
42 }
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:94
bool isCatalogRel
Definition: gistxlog.h:52
TransactionId snapshotConflictHorizon
Definition: gistxlog.h:50
uint16 ntodelete
Definition: gistxlog.h:51

References appendStringInfo(), buf, gistxlogDelete::isCatalogRel, gistxlogDelete::ntodelete, and gistxlogDelete::snapshotConflictHorizon.

Referenced by gist_desc().

◆ out_gistxlogPageDelete()

static void out_gistxlogPageDelete ( StringInfo  buf,
gistxlogPageDelete xlrec 
)
static

Definition at line 52 of file gistdesc.c.

53 {
54  appendStringInfo(buf, "deleteXid %u:%u; downlink %u",
57  xlrec->downlinkOffset);
58 }
FullTransactionId deleteXid
Definition: gistxlog.h:86
OffsetNumber downlinkOffset
Definition: gistxlog.h:87
#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 26 of file gistdesc.c.

27 {
28  appendStringInfo(buf, "rel %u/%u/%u; blk %u; snapshotConflictHorizon %u:%u, isCatalogRel %c",
29  xlrec->locator.spcOid, xlrec->locator.dbOid,
30  xlrec->locator.relNumber, xlrec->block,
33  xlrec->isCatalogRel ? 'T' : 'F');
34 }
RelFileNumber relNumber
RelFileLocator locator
Definition: gistxlog.h:99
BlockNumber block
Definition: gistxlog.h:100
FullTransactionId snapshotConflictHorizon
Definition: gistxlog.h:101

References appendStringInfo(), gistxlogPageReuse::block, buf, RelFileLocator::dbOid, EpochFromFullTransactionId, gistxlogPageReuse::isCatalogRel, gistxlogPageReuse::locator, RelFileLocator::relNumber, gistxlogPageReuse::snapshotConflictHorizon, RelFileLocator::spcOid, and XidFromFullTransactionId.

Referenced by gist_desc().

◆ out_gistxlogPageSplit()

static void out_gistxlogPageSplit ( StringInfo  buf,
gistxlogPageSplit xlrec 
)
static

Definition at line 45 of file gistdesc.c.

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

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

Referenced by gist_desc().

◆ out_gistxlogPageUpdate()

static void out_gistxlogPageUpdate ( StringInfo  buf,
gistxlogPageUpdate xlrec 
)
static

Definition at line 21 of file gistdesc.c.

22 {
23 }

Referenced by gist_desc().