mirror of https://github.com/citusdata/citus.git
Enforce table opt constraints when using alter_columnar_table_set (#5029)
parent
5c6069a74a
commit
a209999618
|
@ -1664,6 +1664,15 @@ alter_columnar_table_set(PG_FUNCTION_ARGS)
|
||||||
if (!PG_ARGISNULL(1))
|
if (!PG_ARGISNULL(1))
|
||||||
{
|
{
|
||||||
options.chunkRowCount = PG_GETARG_INT32(1);
|
options.chunkRowCount = PG_GETARG_INT32(1);
|
||||||
|
if (options.chunkRowCount < CHUNK_ROW_COUNT_MINIMUM ||
|
||||||
|
options.chunkRowCount > CHUNK_ROW_COUNT_MAXIMUM)
|
||||||
|
{
|
||||||
|
ereport(ERROR, (errmsg("chunk group row count limit out of range"),
|
||||||
|
errhint("chunk group row count limit must be between "
|
||||||
|
UINT64_FORMAT " and " UINT64_FORMAT,
|
||||||
|
(uint64) CHUNK_ROW_COUNT_MINIMUM,
|
||||||
|
(uint64) CHUNK_ROW_COUNT_MAXIMUM)));
|
||||||
|
}
|
||||||
ereport(DEBUG1,
|
ereport(DEBUG1,
|
||||||
(errmsg("updating chunk row count to %d", options.chunkRowCount)));
|
(errmsg("updating chunk row count to %d", options.chunkRowCount)));
|
||||||
}
|
}
|
||||||
|
@ -1672,6 +1681,15 @@ alter_columnar_table_set(PG_FUNCTION_ARGS)
|
||||||
if (!PG_ARGISNULL(2))
|
if (!PG_ARGISNULL(2))
|
||||||
{
|
{
|
||||||
options.stripeRowCount = PG_GETARG_INT32(2);
|
options.stripeRowCount = PG_GETARG_INT32(2);
|
||||||
|
if (options.stripeRowCount < STRIPE_ROW_COUNT_MINIMUM ||
|
||||||
|
options.stripeRowCount > STRIPE_ROW_COUNT_MAXIMUM)
|
||||||
|
{
|
||||||
|
ereport(ERROR, (errmsg("stripe row count limit out of range"),
|
||||||
|
errhint("stripe row count limit must be between "
|
||||||
|
UINT64_FORMAT " and " UINT64_FORMAT,
|
||||||
|
(uint64) STRIPE_ROW_COUNT_MINIMUM,
|
||||||
|
(uint64) STRIPE_ROW_COUNT_MAXIMUM)));
|
||||||
|
}
|
||||||
ereport(DEBUG1, (errmsg(
|
ereport(DEBUG1, (errmsg(
|
||||||
"updating stripe row count to " UINT64_FORMAT,
|
"updating stripe row count to " UINT64_FORMAT,
|
||||||
options.stripeRowCount)));
|
options.stripeRowCount)));
|
||||||
|
|
|
@ -129,7 +129,7 @@ $cmd$);
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -141,10 +141,10 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090000,t,100)
|
(localhost,57637,20090000,t,2000)
|
||||||
(localhost,57638,20090001,t,100)
|
(localhost,57638,20090001,t,2000)
|
||||||
(localhost,57637,20090002,t,100)
|
(localhost,57637,20090002,t,2000)
|
||||||
(localhost,57638,20090003,t,100)
|
(localhost,57638,20090003,t,2000)
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -180,7 +180,7 @@ $cmd$);
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -192,10 +192,10 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090000,t,100)
|
(localhost,57637,20090000,t,2000)
|
||||||
(localhost,57638,20090001,t,100)
|
(localhost,57638,20090001,t,2000)
|
||||||
(localhost,57637,20090002,t,100)
|
(localhost,57637,20090002,t,2000)
|
||||||
(localhost,57638,20090003,t,100)
|
(localhost,57638,20090003,t,2000)
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -220,8 +220,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_2',
|
SELECT alter_columnar_table_set('table_option_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 15);
|
compression_level => 15);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
|
@ -241,10 +241,10 @@ SELECT run_command_on_placements('table_option_2',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090004,t,"(100,1000,pglz,15)")
|
(localhost,57637,20090004,t,"(2000,20000,pglz,15)")
|
||||||
(localhost,57638,20090005,t,"(100,1000,pglz,15)")
|
(localhost,57638,20090005,t,"(2000,20000,pglz,15)")
|
||||||
(localhost,57637,20090006,t,"(100,1000,pglz,15)")
|
(localhost,57637,20090006,t,"(2000,20000,pglz,15)")
|
||||||
(localhost,57638,20090007,t,"(100,1000,pglz,15)")
|
(localhost,57638,20090007,t,"(2000,20000,pglz,15)")
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- verify undistribute works
|
-- verify undistribute works
|
||||||
|
@ -424,7 +424,7 @@ $cmd$);
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -436,14 +436,14 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090008,t,100)
|
(localhost,57637,20090008,t,2000)
|
||||||
(localhost,57638,20090008,t,100)
|
(localhost,57638,20090008,t,2000)
|
||||||
(localhost,57637,20090009,t,100)
|
(localhost,57637,20090009,t,2000)
|
||||||
(localhost,57638,20090009,t,100)
|
(localhost,57638,20090009,t,2000)
|
||||||
(localhost,57637,20090010,t,100)
|
(localhost,57637,20090010,t,2000)
|
||||||
(localhost,57638,20090010,t,100)
|
(localhost,57638,20090010,t,2000)
|
||||||
(localhost,57637,20090011,t,100)
|
(localhost,57637,20090011,t,2000)
|
||||||
(localhost,57638,20090011,t,100)
|
(localhost,57638,20090011,t,2000)
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -487,7 +487,7 @@ $cmd$);
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -499,14 +499,14 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090008,t,100)
|
(localhost,57637,20090008,t,2000)
|
||||||
(localhost,57638,20090008,t,100)
|
(localhost,57638,20090008,t,2000)
|
||||||
(localhost,57637,20090009,t,100)
|
(localhost,57637,20090009,t,2000)
|
||||||
(localhost,57638,20090009,t,100)
|
(localhost,57638,20090009,t,2000)
|
||||||
(localhost,57637,20090010,t,100)
|
(localhost,57637,20090010,t,2000)
|
||||||
(localhost,57638,20090010,t,100)
|
(localhost,57638,20090010,t,2000)
|
||||||
(localhost,57637,20090011,t,100)
|
(localhost,57637,20090011,t,2000)
|
||||||
(localhost,57638,20090011,t,100)
|
(localhost,57638,20090011,t,2000)
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -535,8 +535,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_2',
|
SELECT alter_columnar_table_set('table_option_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 19);
|
compression_level => 19);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
|
@ -556,14 +556,14 @@ SELECT run_command_on_placements('table_option_2',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090012,t,"(100,1000,pglz,19)")
|
(localhost,57637,20090012,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57638,20090012,t,"(100,1000,pglz,19)")
|
(localhost,57638,20090012,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57637,20090013,t,"(100,1000,pglz,19)")
|
(localhost,57637,20090013,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57638,20090013,t,"(100,1000,pglz,19)")
|
(localhost,57638,20090013,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57637,20090014,t,"(100,1000,pglz,19)")
|
(localhost,57637,20090014,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57638,20090014,t,"(100,1000,pglz,19)")
|
(localhost,57638,20090014,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57637,20090015,t,"(100,1000,pglz,19)")
|
(localhost,57637,20090015,t,"(2000,20000,pglz,19)")
|
||||||
(localhost,57638,20090015,t,"(100,1000,pglz,19)")
|
(localhost,57638,20090015,t,"(2000,20000,pglz,19)")
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
-- verify undistribute works
|
-- verify undistribute works
|
||||||
|
@ -699,7 +699,7 @@ $cmd$);
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_reference', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_reference', chunk_group_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -711,8 +711,8 @@ SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090016,t,100)
|
(localhost,57637,20090016,t,2000)
|
||||||
(localhost,57638,20090016,t,100)
|
(localhost,57638,20090016,t,2000)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -744,7 +744,7 @@ $cmd$);
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_reference', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_reference', stripe_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -756,8 +756,8 @@ SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090016,t,100)
|
(localhost,57637,20090016,t,2000)
|
||||||
(localhost,57638,20090016,t,100)
|
(localhost,57638,20090016,t,2000)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -780,8 +780,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_reference_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_reference_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_reference_2',
|
SELECT alter_columnar_table_set('table_option_reference_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 9);
|
compression_level => 9);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
|
@ -801,8 +801,8 @@ SELECT run_command_on_placements('table_option_reference_2',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,20090017,t,"(100,1000,pglz,9)")
|
(localhost,57637,20090017,t,"(2000,20000,pglz,9)")
|
||||||
(localhost,57638,20090017,t,"(100,1000,pglz,9)")
|
(localhost,57638,20090017,t,"(2000,20000,pglz,9)")
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
-- verify undistribute works
|
-- verify undistribute works
|
||||||
|
@ -938,7 +938,7 @@ $cmd$);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_citus_local', chunk_group_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57636,20090018,t,100)
|
(localhost,57636,20090018,t,2000)
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -980,7 +980,7 @@ $cmd$);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_citus_local', stripe_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -992,7 +992,7 @@ SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57636,20090018,t,100)
|
(localhost,57636,20090018,t,2000)
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- reset setting
|
-- reset setting
|
||||||
|
@ -1014,8 +1014,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_citus_local_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_citus_local_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local_2',
|
SELECT alter_columnar_table_set('table_option_citus_local_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 9);
|
compression_level => 9);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
|
@ -1035,7 +1035,7 @@ SELECT run_command_on_placements('table_option_citus_local_2',$cmd$
|
||||||
$cmd$);
|
$cmd$);
|
||||||
run_command_on_placements
|
run_command_on_placements
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57636,20090019,t,"(100,1000,pglz,9)")
|
(localhost,57636,20090019,t,"(2000,20000,pglz,9)")
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- verify undistribute works
|
-- verify undistribute works
|
||||||
|
|
|
@ -11,13 +11,13 @@ SELECT alter_columnar_table_set('t_compressed', compression => 'pglz');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT alter_columnar_table_set('t_compressed', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('t_compressed', stripe_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT alter_columnar_table_set('t_compressed', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('t_compressed', chunk_group_row_limit => 1000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ SELECT alter_columnar_table_set('t_compressed', chunk_group_row_limit => 100);
|
||||||
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
t_compressed | 100 | 100 | 3 | pglz
|
t_compressed | 1000 | 2000 | 3 | pglz
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- select
|
-- select
|
||||||
|
|
|
@ -153,7 +153,7 @@ DROP TABLE test_toast_columnar;
|
||||||
-- We support writing into zero column tables, but not reading from them.
|
-- We support writing into zero column tables, but not reading from them.
|
||||||
-- We test that metadata makes sense so we can fix the read path in future.
|
-- We test that metadata makes sense so we can fix the read path in future.
|
||||||
CREATE TABLE zero_col() USING columnar;
|
CREATE TABLE zero_col() USING columnar;
|
||||||
SELECT alter_columnar_table_set('zero_col', chunk_group_row_limit => 10);
|
SELECT alter_columnar_table_set('zero_col', chunk_group_row_limit => 1000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ ORDER BY 1,2,3,4;
|
||||||
zero_col | 2 | 1 | 1
|
zero_col | 2 | 1 | 1
|
||||||
zero_col | 3 | 1 | 1
|
zero_col | 3 | 1 | 1
|
||||||
zero_col | 4 | 1 | 1
|
zero_col | 4 | 1 | 1
|
||||||
zero_col | 5 | 7 | 64
|
zero_col | 5 | 1 | 64
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
||||||
|
@ -201,13 +201,7 @@ ORDER BY 1,2,3,4;
|
||||||
zero_col | 2 | 0 | 1
|
zero_col | 2 | 0 | 1
|
||||||
zero_col | 3 | 0 | 1
|
zero_col | 3 | 0 | 1
|
||||||
zero_col | 4 | 0 | 1
|
zero_col | 4 | 0 | 1
|
||||||
zero_col | 5 | 0 | 10
|
zero_col | 5 | 0 | 64
|
||||||
zero_col | 5 | 1 | 10
|
(5 rows)
|
||||||
zero_col | 5 | 2 | 10
|
|
||||||
zero_col | 5 | 3 | 10
|
|
||||||
zero_col | 5 | 4 | 10
|
|
||||||
zero_col | 5 | 5 | 10
|
|
||||||
zero_col | 5 | 6 | 4
|
|
||||||
(11 rows)
|
|
||||||
|
|
||||||
DROP TABLE zero_col;
|
DROP TABLE zero_col;
|
||||||
|
|
|
@ -42,7 +42,7 @@ WHERE regclass = 'table_options'::regclass;
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- test changing the chunk_group_row_limit
|
-- test changing the chunk_group_row_limit
|
||||||
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 10);
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 2000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -53,11 +53,11 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 10 | 150000 | 5 | pglz
|
table_options | 2000 | 150000 | 5 | pglz
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- test changing the chunk_group_row_limit
|
-- test changing the chunk_group_row_limit
|
||||||
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 4000);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 10 | 100 | 5 | pglz
|
table_options | 2000 | 4000 | 5 | pglz
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming
|
-- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming
|
||||||
|
@ -78,11 +78,11 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 10 | 100 | 5 | pglz
|
table_options | 2000 | 4000 | 5 | pglz
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- set all settings at the same time
|
-- set all settings at the same time
|
||||||
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 1000, chunk_group_row_limit => 100, compression => 'none', compression_level => 7);
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 8000, chunk_group_row_limit => 4000, compression => 'none', compression_level => 7);
|
||||||
alter_columnar_table_set
|
alter_columnar_table_set
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- make sure table options are not changed when VACUUM a table
|
-- make sure table options are not changed when VACUUM a table
|
||||||
|
@ -103,7 +103,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- make sure table options are not changed when VACUUM FULL a table
|
-- make sure table options are not changed when VACUUM FULL a table
|
||||||
|
@ -113,7 +113,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- make sure table options are not changed when truncating a table
|
-- make sure table options are not changed when truncating a table
|
||||||
|
@ -123,7 +123,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
ALTER TABLE table_options ALTER COLUMN a TYPE bigint;
|
ALTER TABLE table_options ALTER COLUMN a TYPE bigint;
|
||||||
|
@ -132,7 +132,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- reset settings one by one to the version of the GUC's
|
-- reset settings one by one to the version of the GUC's
|
||||||
|
@ -146,7 +146,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 100 | 1000 | 7 | none
|
table_options | 4000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT alter_columnar_table_reset('table_options', chunk_group_row_limit => true);
|
SELECT alter_columnar_table_reset('table_options', chunk_group_row_limit => true);
|
||||||
|
@ -160,7 +160,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
table_options | 1000 | 1000 | 7 | none
|
table_options | 1000 | 8000 | 7 | none
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT alter_columnar_table_reset('table_options', stripe_row_limit => true);
|
SELECT alter_columnar_table_reset('table_options', stripe_row_limit => true);
|
||||||
|
@ -254,6 +254,23 @@ HINT: compression level must be between 1 and 19
|
||||||
SELECT alter_columnar_table_set('table_options', compression_level => 20);
|
SELECT alter_columnar_table_set('table_options', compression_level => 20);
|
||||||
ERROR: compression level out of range
|
ERROR: compression level out of range
|
||||||
HINT: compression level must be between 1 and 19
|
HINT: compression level must be between 1 and 19
|
||||||
|
-- verify cannot set out of range stripe_row_limit & chunk_group_row_limit options
|
||||||
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 999);
|
||||||
|
ERROR: stripe row count limit out of range
|
||||||
|
HINT: stripe row count limit must be between 1000 and 10000000
|
||||||
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 10000001);
|
||||||
|
ERROR: stripe row count limit out of range
|
||||||
|
HINT: stripe row count limit must be between 1000 and 10000000
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 999);
|
||||||
|
ERROR: chunk group row count limit out of range
|
||||||
|
HINT: chunk group row count limit must be between 1000 and 100000
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 100001);
|
||||||
|
ERROR: chunk group row count limit out of range
|
||||||
|
HINT: chunk group row count limit must be between 1000 and 100000
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 0);
|
||||||
|
ERROR: chunk group row count limit out of range
|
||||||
|
HINT: chunk group row count limit must be between 1000 and 100000
|
||||||
|
INSERT INTO table_options VALUES (1);
|
||||||
-- verify options are removed when table is dropped
|
-- verify options are removed when table is dropped
|
||||||
DROP TABLE table_options;
|
DROP TABLE table_options;
|
||||||
-- we expect no entries in çstore.options for anything not found int pg_class
|
-- we expect no entries in çstore.options for anything not found int pg_class
|
||||||
|
|
|
@ -272,7 +272,7 @@ IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN
|
||||||
-- create columnar table
|
-- create columnar table
|
||||||
CREATE TABLE columnar_table (a int) USING columnar;
|
CREATE TABLE columnar_table (a int) USING columnar;
|
||||||
-- alter a columnar table that is created by that unprivileged user
|
-- alter a columnar table that is created by that unprivileged user
|
||||||
SELECT alter_columnar_table_set('columnar_table', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('columnar_table', chunk_group_row_limit => 2000);
|
||||||
-- and drop it
|
-- and drop it
|
||||||
DROP TABLE columnar_table;
|
DROP TABLE columnar_table;
|
||||||
$$;
|
$$;
|
||||||
|
|
|
@ -54,7 +54,7 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option',$cmd$
|
SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -72,7 +72,7 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option',$cmd$
|
SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -87,8 +87,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_2',
|
SELECT alter_columnar_table_set('table_option_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 15);
|
compression_level => 15);
|
||||||
SELECT create_distributed_table('table_option_2', 'a');
|
SELECT create_distributed_table('table_option_2', 'a');
|
||||||
|
@ -154,7 +154,7 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', chunk_group_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option',$cmd$
|
SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -172,7 +172,7 @@ SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option', stripe_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option',$cmd$
|
SELECT run_command_on_placements('table_option',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -187,8 +187,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_2',
|
SELECT alter_columnar_table_set('table_option_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 19);
|
compression_level => 19);
|
||||||
SELECT create_distributed_table('table_option_2', 'a');
|
SELECT create_distributed_table('table_option_2', 'a');
|
||||||
|
@ -251,7 +251,7 @@ SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_reference', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_reference', chunk_group_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -269,7 +269,7 @@ SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_reference', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_reference', stripe_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -284,8 +284,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_reference_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_reference_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_reference_2',
|
SELECT alter_columnar_table_set('table_option_reference_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 9);
|
compression_level => 9);
|
||||||
SELECT create_reference_table('table_option_reference_2');
|
SELECT create_reference_table('table_option_reference_2');
|
||||||
|
@ -351,7 +351,7 @@ SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_citus_local', chunk_group_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT chunk_group_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -369,7 +369,7 @@ SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
$cmd$);
|
$cmd$);
|
||||||
-- change setting
|
-- change setting
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_option_citus_local', stripe_row_limit => 2000);
|
||||||
-- verify setting
|
-- verify setting
|
||||||
SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
SELECT run_command_on_placements('table_option_citus_local',$cmd$
|
||||||
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
SELECT stripe_row_limit FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||||
|
@ -384,8 +384,8 @@ $cmd$);
|
||||||
-- verify settings are propagated when creating a table
|
-- verify settings are propagated when creating a table
|
||||||
CREATE TABLE table_option_citus_local_2 (a int, b text) USING columnar;
|
CREATE TABLE table_option_citus_local_2 (a int, b text) USING columnar;
|
||||||
SELECT alter_columnar_table_set('table_option_citus_local_2',
|
SELECT alter_columnar_table_set('table_option_citus_local_2',
|
||||||
chunk_group_row_limit => 100,
|
chunk_group_row_limit => 2000,
|
||||||
stripe_row_limit => 1000,
|
stripe_row_limit => 20000,
|
||||||
compression => 'pglz',
|
compression => 'pglz',
|
||||||
compression_level => 9);
|
compression_level => 9);
|
||||||
SELECT citus_add_local_table_to_metadata('table_option_citus_local_2');
|
SELECT citus_add_local_table_to_metadata('table_option_citus_local_2');
|
||||||
|
|
|
@ -8,8 +8,8 @@ create table t_compressed(a int) using columnar;
|
||||||
|
|
||||||
-- set options
|
-- set options
|
||||||
SELECT alter_columnar_table_set('t_compressed', compression => 'pglz');
|
SELECT alter_columnar_table_set('t_compressed', compression => 'pglz');
|
||||||
SELECT alter_columnar_table_set('t_compressed', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('t_compressed', stripe_row_limit => 2000);
|
||||||
SELECT alter_columnar_table_set('t_compressed', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('t_compressed', chunk_group_row_limit => 1000);
|
||||||
|
|
||||||
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ DROP TABLE test_toast_columnar;
|
||||||
-- We support writing into zero column tables, but not reading from them.
|
-- We support writing into zero column tables, but not reading from them.
|
||||||
-- We test that metadata makes sense so we can fix the read path in future.
|
-- We test that metadata makes sense so we can fix the read path in future.
|
||||||
CREATE TABLE zero_col() USING columnar;
|
CREATE TABLE zero_col() USING columnar;
|
||||||
SELECT alter_columnar_table_set('zero_col', chunk_group_row_limit => 10);
|
SELECT alter_columnar_table_set('zero_col', chunk_group_row_limit => 1000);
|
||||||
|
|
||||||
INSERT INTO zero_col DEFAULT VALUES;
|
INSERT INTO zero_col DEFAULT VALUES;
|
||||||
INSERT INTO zero_col DEFAULT VALUES;
|
INSERT INTO zero_col DEFAULT VALUES;
|
||||||
|
|
|
@ -24,14 +24,14 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
|
|
||||||
-- test changing the chunk_group_row_limit
|
-- test changing the chunk_group_row_limit
|
||||||
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 10);
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 2000);
|
||||||
|
|
||||||
-- show table_options settings
|
-- show table_options settings
|
||||||
SELECT * FROM columnar.options
|
SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
|
|
||||||
-- test changing the chunk_group_row_limit
|
-- test changing the chunk_group_row_limit
|
||||||
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 100);
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 4000);
|
||||||
|
|
||||||
-- show table_options settings
|
-- show table_options settings
|
||||||
SELECT * FROM columnar.options
|
SELECT * FROM columnar.options
|
||||||
|
@ -45,7 +45,7 @@ SELECT * FROM columnar.options
|
||||||
WHERE regclass = 'table_options'::regclass;
|
WHERE regclass = 'table_options'::regclass;
|
||||||
|
|
||||||
-- set all settings at the same time
|
-- set all settings at the same time
|
||||||
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 1000, chunk_group_row_limit => 100, compression => 'none', compression_level => 7);
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 8000, chunk_group_row_limit => 4000, compression => 'none', compression_level => 7);
|
||||||
|
|
||||||
-- show table_options settings
|
-- show table_options settings
|
||||||
SELECT * FROM columnar.options
|
SELECT * FROM columnar.options
|
||||||
|
@ -142,6 +142,14 @@ SELECT alter_columnar_table_set('table_options', compression => 'foobar');
|
||||||
SELECT alter_columnar_table_set('table_options', compression_level => 0);
|
SELECT alter_columnar_table_set('table_options', compression_level => 0);
|
||||||
SELECT alter_columnar_table_set('table_options', compression_level => 20);
|
SELECT alter_columnar_table_set('table_options', compression_level => 20);
|
||||||
|
|
||||||
|
-- verify cannot set out of range stripe_row_limit & chunk_group_row_limit options
|
||||||
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 999);
|
||||||
|
SELECT alter_columnar_table_set('table_options', stripe_row_limit => 10000001);
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 999);
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 100001);
|
||||||
|
SELECT alter_columnar_table_set('table_options', chunk_group_row_limit => 0);
|
||||||
|
INSERT INTO table_options VALUES (1);
|
||||||
|
|
||||||
-- verify options are removed when table is dropped
|
-- verify options are removed when table is dropped
|
||||||
DROP TABLE table_options;
|
DROP TABLE table_options;
|
||||||
-- we expect no entries in çstore.options for anything not found int pg_class
|
-- we expect no entries in çstore.options for anything not found int pg_class
|
||||||
|
|
|
@ -169,7 +169,7 @@ IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN
|
||||||
-- create columnar table
|
-- create columnar table
|
||||||
CREATE TABLE columnar_table (a int) USING columnar;
|
CREATE TABLE columnar_table (a int) USING columnar;
|
||||||
-- alter a columnar table that is created by that unprivileged user
|
-- alter a columnar table that is created by that unprivileged user
|
||||||
SELECT alter_columnar_table_set('columnar_table', chunk_group_row_limit => 100);
|
SELECT alter_columnar_table_set('columnar_table', chunk_group_row_limit => 2000);
|
||||||
-- and drop it
|
-- and drop it
|
||||||
DROP TABLE columnar_table;
|
DROP TABLE columnar_table;
|
||||||
$$;
|
$$;
|
||||||
|
|
Loading…
Reference in New Issue