postgresql/src/backend
Thomas Munro f003d9f872 Add circular WAL decoding buffer.
Teach xlogreader.c to decode its output into a circular buffer, to
support optimizations based on looking ahead.

 * XLogReadRecord() works as before, consuming records one by one, and
   allowing them to be examined via the traditional XLogRecGetXXX()
   macros.

 * An alternative new interface XLogNextRecord() is added that returns
   pointers to DecodedXLogRecord structs that can be examined directly.

 * XLogReadAhead() provides a second cursor that lets you see
   further ahead, as long as data is available and there is enough space
   in the decoding buffer.  This returns DecodedXLogRecord pointers to the
   caller, but also adds them to a queue of records that will later be
   consumed by XLogNextRecord()/XLogReadRecord().

The buffer's size is controlled with wal_decode_buffer_size.  The buffer
could potentially be placed into shared memory, for future projects.
Large records that don't fit in the circular buffer are called
"oversized" and allocated separately with palloc().

Discussion: https://postgr.es/m/CA+hUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq=AovOddfHpA@mail.gmail.com
2021-04-08 23:20:42 +12:00
..
access Add circular WAL decoding buffer. 2021-04-08 23:20:42 +12:00
bootstrap Split backend status and progress related functionality out of pgstat.c. 2021-04-03 11:42:52 -07:00
catalog Add functions to wait for backend termination 2021-04-08 11:40:54 +02:00
commands autovacuum: handle analyze for partitioned tables 2021-04-08 01:19:36 -04:00
executor Cope with NULL query string in ExecInitParallelPlan(). 2021-04-07 22:08:24 -07:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Refactor hba_authname 2021-04-07 14:24:47 +02:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes SQL-standard function body 2021-04-07 21:47:55 +02:00
optimizer SQL-standard function body 2021-04-07 21:47:55 +02:00
parser SQL-standard function body 2021-04-07 21:47:55 +02:00
partitioning Cleanup partition pruning step generation 2021-04-08 22:35:48 +12:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
postmaster autovacuum: handle analyze for partitioned tables 2021-04-08 01:19:36 -04:00
regex Further tweak memory management for regex DFAs. 2021-03-08 16:32:29 -05:00
replication Add circular WAL decoding buffer. 2021-04-08 23:20:42 +12:00
rewrite Clean up treatment of missing default and CHECK-constraint records. 2021-04-06 10:34:39 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Fix handling of clauses incompatible with extended statistics 2021-04-06 16:56:06 +02:00
storage Add functions to wait for backend termination 2021-04-08 11:40:54 +02:00
tcop SQL-standard function body 2021-04-07 21:47:55 +02:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 22:22:47 -04:00
utils Add functions to wait for backend termination 2021-04-08 11:40:54 +02:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00