Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9348b75

Browse files
committed
Fix bug with Lsm3 options
1 parent 7fefb79 commit 9348b75

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lsm3.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ static bytea *
271271
lsm3_options(Datum reloptions, bool validate)
272272
{
273273
static const relopt_parse_elt tab[] = {
274+
{"fillfactor", RELOPT_TYPE_INT, offsetof(BTOptions, fillfactor)},
275+
{"vacuum_cleanup_index_scale_factor", RELOPT_TYPE_REAL,
276+
offsetof(BTOptions, vacuum_cleanup_index_scale_factor)},
277+
{"deduplicate_items", RELOPT_TYPE_BOOL,
278+
offsetof(BTOptions, deduplicate_items)},
274279
{"top_index_size", RELOPT_TYPE_INT, offsetof(Lsm3Options, top_index_size)},
275280
{"unique", RELOPT_TYPE_BOOL, offsetof(Lsm3Options, unique)}
276281
};
@@ -974,12 +979,22 @@ _PG_init(void)
974979
NULL);
975980

976981
Lsm3ReloptKind = add_reloption_kind();
982+
977983
add_bool_reloption(Lsm3ReloptKind, "unique",
978984
"Index contains no duplicates",
979985
false, AccessExclusiveLock);
980986
add_int_reloption(Lsm3ReloptKind, "top_index_size",
981987
"Size of top index (kb)",
982988
0, 0, INT_MAX, AccessExclusiveLock);
989+
add_int_reloption(Lsm3ReloptKind, "fillfactor",
990+
"Packs btree index pages only to this percentage",
991+
BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100, ShareUpdateExclusiveLock);
992+
add_real_reloption(Lsm3ReloptKind, "vacuum_cleanup_index_scale_factor",
993+
"Packs btree index pages only to this percentage",
994+
-1, 0.0, 1e10, ShareUpdateExclusiveLock);
995+
add_bool_reloption(Lsm3ReloptKind, "deduplicate_items",
996+
"Enables \"deduplicate items\" feature for this btree index",
997+
true, AccessExclusiveLock);
983998

984999
RequestAddinShmemSpace(hash_estimate_size(Lsm3MaxIndexes, sizeof(Lsm3DictEntry)));
9851000
RequestNamedLWLockTranche("lsm3", 1);

lsm3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef struct
4343
/* Lsm3 index options */
4444
typedef struct
4545
{
46-
int32 vl_len_; /* Varlena header (do not touch directly!) */
46+
BTOptions nbt_opts; /* Standard B-Tree options */
4747
int top_index_size; /* Size of top index (overrode lsm3.top_index_size GUC */
4848
bool unique; /* Index may not contain duplicates. We prohibit unique constraint for Lsm3 index
4949
* because it can not be enforced. But presence of this index option allows to optimize

0 commit comments

Comments
 (0)