diff options
author | Michael Paquier | 2019-11-25 00:40:53 +0000 |
---|---|---|
committer | Michael Paquier | 2019-11-25 00:40:53 +0000 |
commit | 4cb658af70027c3544fb843d77b2e84028762747 (patch) | |
tree | 1d349468c9a4878c820de2b4e2e011ad413efa96 /src/backend/access/nbtree/nbtree.c | |
parent | 114541d58e5970e51b78b77b65de16210beaab43 (diff) |
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
Diffstat (limited to 'src/backend/access/nbtree/nbtree.c')
-rw-r--r-- | src/backend/access/nbtree/nbtree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 4cfd5289ad7..c67235ab807 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -816,7 +816,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info) } else { - StdRdOptions *relopts; + BTOptions *relopts; float8 cleanup_scale_factor; float8 prev_num_heap_tuples; @@ -827,7 +827,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info) * tuples exceeds vacuum_cleanup_index_scale_factor fraction of * original tuples count. */ - relopts = (StdRdOptions *) info->index->rd_options; + relopts = (BTOptions *) info->index->rd_options; cleanup_scale_factor = (relopts && relopts->vacuum_cleanup_index_scale_factor >= 0) ? relopts->vacuum_cleanup_index_scale_factor |