mirror of https://github.com/citusdata/citus.git
add GUCs
parent
d7f40f3be6
commit
12daf4c317
55
cstore.c
55
cstore.c
|
@ -17,10 +17,65 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
|
#include "utils/guc.h"
|
||||||
#include "utils/rel.h"
|
#include "utils/rel.h"
|
||||||
|
|
||||||
#include "cstore.h"
|
#include "cstore.h"
|
||||||
|
|
||||||
|
int cstore_compression = DEFAULT_COMPRESSION_TYPE;
|
||||||
|
int cstore_stripe_row_count = DEFAULT_STRIPE_ROW_COUNT;
|
||||||
|
int cstore_block_row_count = DEFAULT_BLOCK_ROW_COUNT;
|
||||||
|
|
||||||
|
static const struct config_enum_entry cstore_compression_options[] =
|
||||||
|
{
|
||||||
|
{"none", COMPRESSION_NONE, false},
|
||||||
|
{"pglz", COMPRESSION_PG_LZ, false},
|
||||||
|
{NULL, 0, false}
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
cstore_init()
|
||||||
|
{
|
||||||
|
DefineCustomEnumVariable("cstore.compression",
|
||||||
|
"Sets the maximum number of statements tracked by pg_stat_statements.",
|
||||||
|
NULL,
|
||||||
|
&cstore_compression,
|
||||||
|
DEFAULT_COMPRESSION_TYPE,
|
||||||
|
cstore_compression_options,
|
||||||
|
PGC_POSTMASTER,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
DefineCustomIntVariable("cstore.stripe_row_count",
|
||||||
|
"Sets the maximum number of statements tracked by pg_stat_statements.",
|
||||||
|
NULL,
|
||||||
|
&cstore_stripe_row_count,
|
||||||
|
DEFAULT_STRIPE_ROW_COUNT,
|
||||||
|
STRIPE_ROW_COUNT_MINIMUM,
|
||||||
|
STRIPE_ROW_COUNT_MAXIMUM,
|
||||||
|
PGC_USERSET,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
DefineCustomIntVariable("cstore.block_row_count",
|
||||||
|
"Sets the maximum number of statements tracked by pg_stat_statements.",
|
||||||
|
NULL,
|
||||||
|
&cstore_block_row_count,
|
||||||
|
DEFAULT_BLOCK_ROW_COUNT,
|
||||||
|
BLOCK_ROW_COUNT_MINIMUM,
|
||||||
|
BLOCK_ROW_COUNT_MAXIMUM,
|
||||||
|
PGC_USERSET,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ParseCompressionType converts a string to a compression type. */
|
/* ParseCompressionType converts a string to a compression type. */
|
||||||
CompressionType
|
CompressionType
|
||||||
ParseCompressionType(const char *compressionTypeString)
|
ParseCompressionType(const char *compressionTypeString)
|
||||||
|
|
6
cstore.h
6
cstore.h
|
@ -249,6 +249,12 @@ typedef struct TableWriteState
|
||||||
StringInfo compressionBuffer;
|
StringInfo compressionBuffer;
|
||||||
} TableWriteState;
|
} TableWriteState;
|
||||||
|
|
||||||
|
extern int cstore_compression;
|
||||||
|
extern int cstore_stripe_row_count;
|
||||||
|
extern int cstore_block_row_count;
|
||||||
|
|
||||||
|
extern void cstore_init(void);
|
||||||
|
|
||||||
extern CompressionType ParseCompressionType(const char *compressionTypeString);
|
extern CompressionType ParseCompressionType(const char *compressionTypeString);
|
||||||
extern void InitializeCStoreTableFile(Oid relationId, Relation relation,
|
extern void InitializeCStoreTableFile(Oid relationId, Relation relation,
|
||||||
CStoreOptions *cstoreOptions);
|
CStoreOptions *cstoreOptions);
|
||||||
|
|
3
mod.c
3
mod.c
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "fmgr.h"
|
#include "fmgr.h"
|
||||||
|
|
||||||
|
#include "cstore.h"
|
||||||
#include "mod.h"
|
#include "mod.h"
|
||||||
|
|
||||||
#ifdef USE_TABLEAM
|
#ifdef USE_TABLEAM
|
||||||
|
@ -30,6 +31,8 @@ PG_MODULE_MAGIC;
|
||||||
void
|
void
|
||||||
_PG_init(void)
|
_PG_init(void)
|
||||||
{
|
{
|
||||||
|
cstore_init();
|
||||||
|
|
||||||
#ifdef USE_TABLEAM
|
#ifdef USE_TABLEAM
|
||||||
cstore_tableam_init();
|
cstore_tableam_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue