Re: Refactor how we form HeapTuples for CatalogTuple(Insert|Update) - Mailing list pgsql-hackers

From Greg Burd
Subject Re: Refactor how we form HeapTuples for CatalogTuple(Insert|Update)
Date
Msg-id D430151C-B902-41D6-AA18-104D0CF8542C@greg.burd.me
Whole thread Raw
In response to Re: Refactor how we form HeapTuples for CatalogTuple(Insert|Update)  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers
Rebased.

I had started down a road where I was creating a number of new macros to
cover up more of the implementation details related to catalog tuple
updates. Then I felt that I was too far down the path and reverted to
the design in v1 with a simple layer that tracks what's been updated in
a Bitmapset and then passes that along to simple_heap_update() and then
to heapam_update().  This avoids the need to call
HeapDetermineColumnsInfo() inside heapam_update() when updating catalog
tuples.  The rest of the calls to heapam_handle_update() still use
HeapDetermineColumnsInfo(), but if you look at my cf-5556 thread [1]
you'll see that I have fixed that side of the equation as well.  cf-6221
and cf-5556 are two pieces of a puzzle.


0001 - adds macros to htup.h that cover the two models we have for
catalog tuple updates; Form/GETSTRUCT, and values/nulls/replaces.  Also
included in this patch are a few of the more tricky cases as a way to
call them out.

0002 - the remaining files containing catalog tuple updates converted to
the use the new macros

0003 - a patch borrowed from cf-5556 that splits the top half of
heap_update() into heapam_handle_update() and simple_heap_update().  The
only change here vs in cf-5556 is that we pass on the updated bitmap
into heap_update().

thanks for your time and feedback,

best.

-greg

[1] https://commitfest.postgresql.org/patch/5556/
Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: remove the unneeded header file math.h in binaryheap.c
Next
From: Dharin Shah
Date:
Subject: Re: [Patch] Add WHERE clause support to REFRESH MATERIALIZED VIEW