mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Skip checkpoints, archiving on idle systems.
Some background activity (like checkpoints, archive timeout, standby snapshots) is not supposed to happen on an idle system. Unfortunately so far it was not easy to determine when a system is idle, which defeated some of the attempts to avoid redundant activity on an idle system. To make that easier, allow to make individual WAL insertions as not being "important". By checking whether any important activity happened since the last time an activity was performed, it now is easy to check whether some action needs to be repeated. Use the new facility for checkpoints, archive timeout and standby snapshots. The lack of a facility causes some issues in older releases, but in my opinion the consequences (superflous checkpoints / archived segments) aren't grave enough to warrant backpatching. Author: Michael Paquier, editorialized by Andres Freund Reviewed-By: Andres Freund, David Steele, Amit Kapila, Kyotaro HORIGUCHI Bug: #13685 Discussion: https://www.postgresql.org/message-id/20151016203031.3019.72930@wrigleys.postgresql.org https://www.postgresql.org/message-id/CAB7nPqQcPqxEM3S735Bd2RzApNqSNJVietAC=6kfkYv_45dKwA@mail.gmail.com Backpatch: -
This commit is contained in:
@ -2507,7 +2507,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
|
||||
heaptup->t_len - SizeofHeapTupleHeader);
|
||||
|
||||
/* filtering by origin on a row level is much more efficient */
|
||||
XLogIncludeOrigin();
|
||||
XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN);
|
||||
|
||||
recptr = XLogInsert(RM_HEAP_ID, info);
|
||||
|
||||
@ -2846,7 +2846,7 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
|
||||
XLogRegisterBufData(0, tupledata, totaldatalen);
|
||||
|
||||
/* filtering by origin on a row level is much more efficient */
|
||||
XLogIncludeOrigin();
|
||||
XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN);
|
||||
|
||||
recptr = XLogInsert(RM_HEAP2_ID, info);
|
||||
|
||||
@ -3308,7 +3308,7 @@ l1:
|
||||
}
|
||||
|
||||
/* filtering by origin on a row level is much more efficient */
|
||||
XLogIncludeOrigin();
|
||||
XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN);
|
||||
|
||||
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_DELETE);
|
||||
|
||||
@ -6035,7 +6035,7 @@ heap_finish_speculative(Relation relation, HeapTuple tuple)
|
||||
XLogBeginInsert();
|
||||
|
||||
/* We want the same filtering on this as on a plain insert */
|
||||
XLogIncludeOrigin();
|
||||
XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN);
|
||||
|
||||
XLogRegisterData((char *) &xlrec, SizeOfHeapConfirm);
|
||||
XLogRegisterBuffer(0, buffer, REGBUF_STANDARD);
|
||||
@ -7703,7 +7703,7 @@ log_heap_update(Relation reln, Buffer oldbuf,
|
||||
}
|
||||
|
||||
/* filtering by origin on a row level is much more efficient */
|
||||
XLogIncludeOrigin();
|
||||
XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN);
|
||||
|
||||
recptr = XLogInsert(RM_HEAP_ID, info);
|
||||
|
||||
|
Reference in New Issue
Block a user