PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
gistxlog.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * gistxlog.h
4  * gist xlog routines
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/access/gistxlog.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef GIST_XLOG_H
14 #define GIST_XLOG_H
15 
16 #include "access/gist.h"
17 #include "access/xlogreader.h"
18 #include "lib/stringinfo.h"
19 
20 #define XLOG_GIST_PAGE_UPDATE 0x00
21  /* #define XLOG_GIST_NEW_ROOT 0x20 */ /* not used anymore */
22 #define XLOG_GIST_PAGE_SPLIT 0x30
23  /* #define XLOG_GIST_INSERT_COMPLETE 0x40 */ /* not used anymore */
24 #define XLOG_GIST_CREATE_INDEX 0x50
25  /* #define XLOG_GIST_PAGE_DELETE 0x60 */ /* not used anymore */
26 
27 /*
28  * Backup Blk 0: updated page.
29  * Backup Blk 1: If this operation completes a page split, by inserting a
30  * downlink for the split page, the left half of the split
31  */
32 typedef struct gistxlogPageUpdate
33 {
34  /* number of deleted offsets */
37 
38  /*
39  * In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
40  */
42 
43 /*
44  * Backup Blk 0: If this operation completes a page split, by inserting a
45  * downlink for the split page, the left half of the split
46  * Backup Blk 1 - npage: split pages (1 is the original page)
47  */
48 typedef struct gistxlogPageSplit
49 {
50  BlockNumber origrlink; /* rightlink of the page before split */
51  GistNSN orignsn; /* NSN of the page before split */
52  bool origleaf; /* was splitted page a leaf page? */
53 
54  uint16 npage; /* # of pages in the split */
55  bool markfollowright; /* set F_FOLLOW_RIGHT flags */
56 
57  /*
58  * follow: 1. gistxlogPage and array of IndexTupleData per page
59  */
61 
62 extern void gist_redo(XLogReaderState *record);
63 extern void gist_desc(StringInfo buf, XLogReaderState *record);
64 extern const char *gist_identify(uint8 info);
65 extern void gist_xlog_startup(void);
66 extern void gist_xlog_cleanup(void);
67 extern void gist_mask(char *pagedata, BlockNumber blkno);
68 
69 #endif
void gist_desc(StringInfo buf, XLogReaderState *record)
Definition: gistdesc.c:34
struct gistxlogPageUpdate gistxlogPageUpdate
const char * gist_identify(uint8 info)
Definition: gistdesc.c:53
bool markfollowright
Definition: gistxlog.h:55
unsigned char uint8
Definition: c.h:263
uint16 ntoinsert
Definition: gistxlog.h:36
uint32 BlockNumber
Definition: block.h:31
void gist_mask(char *pagedata, BlockNumber blkno)
Definition: gistxlog.c:351
uint16 ntodelete
Definition: gistxlog.h:35
struct gistxlogPageSplit gistxlogPageSplit
unsigned short uint16
Definition: c.h:264
static char * buf
Definition: pg_test_fsync.c:65
BlockNumber origrlink
Definition: gistxlog.h:50
GistNSN orignsn
Definition: gistxlog.h:51
void gist_xlog_cleanup(void)
Definition: gistxlog.c:342
void gist_redo(XLogReaderState *record)
Definition: gistxlog.c:304
XLogRecPtr GistNSN
Definition: gist.h:50
void gist_xlog_startup(void)
Definition: gistxlog.c:336