pgsql: Trim TIDs during parallel GIN builds more eagerly - Mailing list pgsql-committers

From Tomas Vondra
Subject pgsql: Trim TIDs during parallel GIN builds more eagerly
Date
Msg-id E1vGMdP-0052N4-15@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Trim TIDs during parallel GIN builds more eagerly

The parallel GIN builds perform "freezing" of TID lists when merging
chunks built earlier. This means determining what part of the list can
no longer change, depending on the last received chunk. The frozen part
can be evicted from memory and written out.

The code attempted to freeze items right before merging the old and new
TID list, after already attempting to trim the current buffer. That
means part of the data may get frozen based on the new TID list, but
will be trimmed later (on next loop). This increases memory usage.

This inverts the order, so that we freeze data first (before trimming).
The benefits are likely relatively small, but it's also virtually free
with no other downsides.

Discussion: https://postgr.es/m/CAHLJuCWDwn-PE2BMZE4Kux7x5wWt_6RoWtA0mUQffEDLeZ6sfA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1213cb475391640508d2495b2b560329897d152c

Modified Files
--------------
src/backend/access/gin/gininsert.c | 78 ++++++++++++++++++--------------------
1 file changed, 36 insertions(+), 42 deletions(-)


pgsql-committers by date:

Previous
From: Masahiko Sawada
Date:
Subject: pgsql: psql: Add tab completion for COPY ... PROGRAM.
Next
From: Álvaro Herrera
Date:
Subject: pgsql: Fix snapshot handling bug in recent BRIN fix