Refactor reloption handling for index AMs in-core
authorMichael Paquier <michael@paquier.xyz>
Mon, 25 Nov 2019 00:40:53 +0000 (09:40 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 25 Nov 2019 00:40:53 +0000 (09:40 +0900)
commit4cb658af70027c3544fb843d77b2e84028762747
tree1d349468c9a4878c820de2b4e2e011ad413efa96
parent114541d58e5970e51b78b77b65de16210beaab43
Refactor reloption handling for index AMs in-core

This reworks the reloption parsing and build of a couple of index AMs by
creating new structures for each index AM's options.  This split was
already done for BRIN, GIN and GiST (which actually has a fillfactor
parameter), but not for hash, B-tree and SPGiST which relied on
StdRdOptions due to an overlap with the default option set.

This saves a couple of bytes for rd_options in each relcache entry with
indexes making use of relation options, and brings more consistency
between all index AMs.  While on it, add a couple of AssertMacro() calls
to make sure that utility macros to grab values of reloptions are used
with the expected index AM.

Author: Nikolay Shaplov
Reviewed-by: Amit Langote, Michael Paquier, Álvaro Herrera, Dent John
Discussion: https://postgr.es/m/4127670.gFlpRb6XCm@x200m
16 files changed:
src/backend/access/common/reloptions.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashutil.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/nbtree/nbtsplitloc.c
src/backend/access/nbtree/nbtutils.c
src/backend/access/spgist/spgutils.c
src/include/access/brin.h
src/include/access/gin_private.h
src/include/access/hash.h
src/include/access/nbtree.h
src/include/access/spgist.h
src/include/access/spgist_private.h
src/include/utils/rel.h
src/tools/pgindent/typedefs.list