mirror of https://github.com/citusdata/citus.git
use GUCs
parent
9f9bb64c4c
commit
fbe4728287
5
cstore.c
5
cstore.c
|
@ -22,6 +22,11 @@
|
|||
|
||||
#include "cstore.h"
|
||||
|
||||
/* Default values for option parameters */
|
||||
#define DEFAULT_COMPRESSION_TYPE COMPRESSION_NONE
|
||||
#define DEFAULT_STRIPE_ROW_COUNT 150000
|
||||
#define DEFAULT_BLOCK_ROW_COUNT 10000
|
||||
|
||||
int cstore_compression = DEFAULT_COMPRESSION_TYPE;
|
||||
int cstore_stripe_row_count = DEFAULT_STRIPE_ROW_COUNT;
|
||||
int cstore_block_row_count = DEFAULT_BLOCK_ROW_COUNT;
|
||||
|
|
5
cstore.h
5
cstore.h
|
@ -24,11 +24,6 @@
|
|||
#define OPTION_NAME_STRIPE_ROW_COUNT "stripe_row_count"
|
||||
#define OPTION_NAME_BLOCK_ROW_COUNT "block_row_count"
|
||||
|
||||
/* Default values for option parameters */
|
||||
#define DEFAULT_COMPRESSION_TYPE COMPRESSION_NONE
|
||||
#define DEFAULT_STRIPE_ROW_COUNT 150000
|
||||
#define DEFAULT_BLOCK_ROW_COUNT 10000
|
||||
|
||||
/* Limits for option parameters */
|
||||
#define STRIPE_ROW_COUNT_MINIMUM 1000
|
||||
#define STRIPE_ROW_COUNT_MAXIMUM 10000000
|
||||
|
|
|
@ -1260,9 +1260,9 @@ static CStoreOptions *
|
|||
CStoreGetOptions(Oid foreignTableId)
|
||||
{
|
||||
CStoreOptions *cstoreOptions = NULL;
|
||||
CompressionType compressionType = DEFAULT_COMPRESSION_TYPE;
|
||||
int32 stripeRowCount = DEFAULT_STRIPE_ROW_COUNT;
|
||||
int32 blockRowCount = DEFAULT_BLOCK_ROW_COUNT;
|
||||
CompressionType compressionType = cstore_compression;
|
||||
int32 stripeRowCount = cstore_stripe_row_count;
|
||||
int32 blockRowCount = cstore_block_row_count;
|
||||
char *compressionTypeString = NULL;
|
||||
char *stripeRowCountString = NULL;
|
||||
char *blockRowCountString = NULL;
|
||||
|
|
|
@ -47,12 +47,12 @@ static ExecutorEnd_hook_type PreviousExecutorEndHook = NULL;
|
|||
static MemoryContext CStoreContext = NULL;
|
||||
|
||||
static CStoreOptions *
|
||||
CStoreGetDefaultOptions(void)
|
||||
CStoreTableAMGetOptions(void)
|
||||
{
|
||||
CStoreOptions *cstoreOptions = palloc0(sizeof(CStoreOptions));
|
||||
cstoreOptions->compressionType = DEFAULT_COMPRESSION_TYPE;
|
||||
cstoreOptions->stripeRowCount = DEFAULT_STRIPE_ROW_COUNT;
|
||||
cstoreOptions->blockRowCount = DEFAULT_BLOCK_ROW_COUNT;
|
||||
cstoreOptions->compressionType = cstore_compression;
|
||||
cstoreOptions->stripeRowCount = cstore_stripe_row_count;
|
||||
cstoreOptions->blockRowCount = cstore_block_row_count;
|
||||
return cstoreOptions;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ cstore_init_write_state(Relation relation)
|
|||
|
||||
if (CStoreWriteState == NULL)
|
||||
{
|
||||
CStoreOptions *cstoreOptions = CStoreGetDefaultOptions();
|
||||
CStoreOptions *cstoreOptions = CStoreTableAMGetOptions();
|
||||
TupleDesc tupdesc = RelationGetDescr(relation);
|
||||
MemoryContext oldContext;
|
||||
|
||||
|
@ -128,7 +128,7 @@ cstore_beginscan(Relation relation, Snapshot snapshot,
|
|||
CStoreScanDesc scan = palloc(sizeof(CStoreScanDescData));
|
||||
List *columnList = NIL;
|
||||
|
||||
cstoreOptions = CStoreGetDefaultOptions();
|
||||
cstoreOptions = CStoreTableAMGetOptions();
|
||||
|
||||
scan->cs_base.rs_rd = relation;
|
||||
scan->cs_base.rs_snapshot = snapshot;
|
||||
|
@ -419,7 +419,7 @@ cstore_relation_set_new_filenode(Relation rel,
|
|||
*freezeXid = RecentXmin;
|
||||
*minmulti = GetOldestMultiXactId();
|
||||
srel = RelationCreateStorage(*newrnode, persistence);
|
||||
InitializeCStoreTableFile(rel->rd_id, rel, CStoreGetDefaultOptions());
|
||||
InitializeCStoreTableFile(rel->rd_id, rel, CStoreTableAMGetOptions());
|
||||
smgrclose(srel);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue