Columnar: few fixes (#4371)

* Columnar: fix a memory issue

* Columnar: no need for deferred triggers

* Columnar: relax memory growth constraints
pull/4356/head
Hadi Moshayedi 2020-11-30 18:09:43 -08:00 committed by GitHub
parent a94e8c9cda
commit feecb7b423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -112,7 +112,7 @@ CStoreBeginWrite(RelFileNode relfilenode,
writeState->stripeWriteContext = stripeWriteContext;
writeState->blockData = blockData;
writeState->compressionBuffer = NULL;
writeState->perTupleContext = AllocSetContextCreate(stripeWriteContext,
writeState->perTupleContext = AllocSetContextCreate(CurrentMemoryContext,
"CStore per tuple context",
ALLOCSET_DEFAULT_SIZES);

View File

@ -42,7 +42,7 @@ CREATE TABLE cstore_skipnodes (
exists_stream_length bigint NOT NULL,
value_compression_type int NOT NULL,
PRIMARY KEY (storageid, stripe, attr, block),
FOREIGN KEY (storageid, stripe) REFERENCES cstore_stripes(storageid, stripe) ON DELETE CASCADE INITIALLY DEFERRED
FOREIGN KEY (storageid, stripe) REFERENCES cstore_stripes(storageid, stripe) ON DELETE CASCADE
) WITH (user_catalog_table = true);
COMMENT ON TABLE cstore_skipnodes IS 'CStore per block metadata';

View File

@ -81,7 +81,7 @@ write_clear_outside_xact | t
INSERT INTO t
SELECT i, 'last batch', 0 /* no need to record memusage per row */
FROM generate_series(1, 50000) i;
SELECT 1.0 * TopMemoryContext / :top_post BETWEEN 0.99 AND 1.01 AS top_growth_ok
SELECT 1.0 * TopMemoryContext / :top_post BETWEEN 0.98 AND 1.02 AS top_growth_ok
FROM column_store_memory_stats();
-[ RECORD 1 ]-+--
top_growth_ok | t

View File

@ -85,7 +85,7 @@ INSERT INTO t
SELECT i, 'last batch', 0 /* no need to record memusage per row */
FROM generate_series(1, 50000) i;
SELECT 1.0 * TopMemoryContext / :top_post BETWEEN 0.99 AND 1.01 AS top_growth_ok
SELECT 1.0 * TopMemoryContext / :top_post BETWEEN 0.98 AND 1.02 AS top_growth_ok
FROM column_store_memory_stats();
-- before this change, max mem usage while executing inserts was 28MB and