mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Buffering GiST index build algorithm.
When building a GiST index that doesn't fit in cache, buffers are attached to some internal nodes in the index. This speeds up the build by avoiding random I/O that would otherwise be needed to traverse all the way down the tree to the find right leaf page for tuple. Alexander Korotkov
This commit is contained in:
@ -667,13 +667,30 @@ gistoptions(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Datum reloptions = PG_GETARG_DATUM(0);
|
||||
bool validate = PG_GETARG_BOOL(1);
|
||||
bytea *result;
|
||||
relopt_value *options;
|
||||
GiSTOptions *rdopts;
|
||||
int numoptions;
|
||||
static const relopt_parse_elt tab[] = {
|
||||
{"fillfactor", RELOPT_TYPE_INT, offsetof(GiSTOptions, fillfactor)},
|
||||
{"buffering", RELOPT_TYPE_STRING, offsetof(GiSTOptions, bufferingModeOffset)}
|
||||
};
|
||||
|
||||
result = default_reloptions(reloptions, validate, RELOPT_KIND_GIST);
|
||||
options = parseRelOptions(reloptions, validate, RELOPT_KIND_GIST,
|
||||
&numoptions);
|
||||
|
||||
/* if none set, we're done */
|
||||
if (numoptions == 0)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
rdopts = allocateReloptStruct(sizeof(GiSTOptions), options, numoptions);
|
||||
|
||||
fillRelOptions((void *) rdopts, sizeof(GiSTOptions), options, numoptions,
|
||||
validate, tab, lengthof(tab));
|
||||
|
||||
pfree(options);
|
||||
|
||||
PG_RETURN_BYTEA_P(rdopts);
|
||||
|
||||
if (result)
|
||||
PG_RETURN_BYTEA_P(result);
|
||||
PG_RETURN_NULL();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user