pgsql: Refactor nbtree high key truncation.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor nbtree high key truncation.
Date: 2020-03-30 22:54:03
Message-ID: E1jJ3IB-0004cc-Ld@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor nbtree high key truncation.

Simplify _bt_truncate(), the routine that generates truncated leaf page
high keys. Remove a micro-optimization that avoided a second palloc0()
call (this was used when a heap TID was needed in the final pivot tuple,
though only when the index happened to not be an INCLUDE index).

Removing this dubious micro-optimization allows _bt_truncate() to use
the index_truncate_tuple() indextuple.c utility routine in all cases.
This was already the common case.

This commit is a HEAD-only follow up to bugfix commit 4b42a899.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7c2dbc691c3e19b7d33c78f6c8aacc6e0cab510b

Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 130 ++++++++++++-----------------------
1 file changed, 45 insertions(+), 85 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2020-03-30 23:28:30 pgsql: Revert "Skip redundant anti-wraparound vacuums"
Previous Message Andres Freund 2020-03-30 21:15:50 Re: pgsql: Implement operator class parameters