summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2011-06-28 22:58:17 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2011-06-28 22:58:17 +0100
commit465883b0a2b4236ba6b31b648a9eabef3b7cdddb (patch)
tree830d1e0365e02b4a9fa897eb1a084b36f342e428 /src/include
parent6f3efa76b042cdc457dba5bf8d8257f3ae83fb10 (diff)
downloadpostgresql-465883b0a2b4236ba6b31b648a9eabef3b7cdddb.tar.gz
Introduce compact WAL record for the common case of commit (non-DDL).
XLOG_XACT_COMMIT_COMPACT leaves out invalidation messages and relfilenodes, saving considerable space for the vast majority of transaction commits. XLOG_XACT_COMMIT keeps same definition as XLOG_PAGE_MAGIC 0xD067 and earlier. Leonardo Francalanci and Simon Riggs
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/xact.h15
-rw-r--r--src/include/access/xlog_internal.h2
2 files changed, 14 insertions, 3 deletions
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index cb440d41f1..c585752b00 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -106,6 +106,7 @@ typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid,
#define XLOG_XACT_COMMIT_PREPARED 0x30
#define XLOG_XACT_ABORT_PREPARED 0x40
#define XLOG_XACT_ASSIGNMENT 0x50
+#define XLOG_XACT_COMMIT_COMPACT 0x60
typedef struct xl_xact_assignment
{
@@ -116,6 +117,16 @@ typedef struct xl_xact_assignment
#define MinSizeOfXactAssignment offsetof(xl_xact_assignment, xsub)
+typedef struct xl_xact_commit_compact
+{
+ TimestampTz xact_time; /* time of commit */
+ int nsubxacts; /* number of subtransaction XIDs */
+ /* ARRAY OF COMMITTED SUBTRANSACTION XIDs FOLLOWS */
+ TransactionId subxacts[1]; /* VARIABLE LENGTH ARRAY */
+} xl_xact_commit_compact;
+
+#define MinSizeOfXactCommitCompact offsetof(xl_xact_commit_compact, subxacts)
+
typedef struct xl_xact_commit
{
TimestampTz xact_time; /* time of commit */
@@ -145,8 +156,8 @@ typedef struct xl_xact_commit
#define XACT_COMPLETION_FORCE_SYNC_COMMIT 0x02
/* Access macros for above flags */
-#define XactCompletionRelcacheInitFileInval(xlrec) ((xlrec)->xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE)
-#define XactCompletionForceSyncCommit(xlrec) ((xlrec)->xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT)
+#define XactCompletionRelcacheInitFileInval(xinfo) (xinfo & XACT_COMPLETION_UPDATE_RELCACHE_FILE)
+#define XactCompletionForceSyncCommit(xinfo) (xinfo & XACT_COMPLETION_FORCE_SYNC_COMMIT)
typedef struct xl_xact_abort
{
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 34316fffeb..4eaa243948 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -71,7 +71,7 @@ typedef struct XLogContRecord
/*
* Each page of XLOG file has a header like this:
*/
-#define XLOG_PAGE_MAGIC 0xD067 /* can be used as WAL version indicator */
+#define XLOG_PAGE_MAGIC 0xD068 /* can be used as WAL version indicator */
typedef struct XLogPageHeaderData
{