mirror of https://github.com/citusdata/citus.git
Merge pull request #4396 from citusdata/rename2
Rename cstore->columnar in SQL objects and errors.pull/4337/head
commit
776c165843
|
@ -41,7 +41,7 @@ static const struct config_enum_entry cstore_compression_options[] =
|
|||
void
|
||||
cstore_init()
|
||||
{
|
||||
DefineCustomEnumVariable("cstore.compression",
|
||||
DefineCustomEnumVariable("columnar.compression",
|
||||
"Compression type for cstore.",
|
||||
NULL,
|
||||
&cstore_compression,
|
||||
|
@ -53,7 +53,7 @@ cstore_init()
|
|||
NULL,
|
||||
NULL);
|
||||
|
||||
DefineCustomIntVariable("cstore.stripe_row_count",
|
||||
DefineCustomIntVariable("columnar.stripe_row_count",
|
||||
"Maximum number of tuples per stripe.",
|
||||
NULL,
|
||||
&cstore_stripe_row_count,
|
||||
|
@ -66,7 +66,7 @@ cstore_init()
|
|||
NULL,
|
||||
NULL);
|
||||
|
||||
DefineCustomIntVariable("cstore.chunk_row_count",
|
||||
DefineCustomIntVariable("columnar.chunk_row_count",
|
||||
"Maximum number of rows per chunk.",
|
||||
NULL,
|
||||
&cstore_chunk_row_count,
|
||||
|
|
|
@ -109,7 +109,7 @@ cstore_customscan_init()
|
|||
|
||||
/* register customscan specific GUC's */
|
||||
DefineCustomBoolVariable(
|
||||
"cstore.enable_custom_scan",
|
||||
"columnar.enable_custom_scan",
|
||||
gettext_noop("Enables the use of a custom scan to push projections and quals "
|
||||
"into the storage layer"),
|
||||
NULL,
|
||||
|
|
|
@ -101,7 +101,7 @@ static bool WriteColumnarOptions(Oid regclass, ColumnarOptions *options, bool ov
|
|||
|
||||
PG_FUNCTION_INFO_V1(columnar_relation_storageid);
|
||||
|
||||
/* constants for cstore.options */
|
||||
/* constants for columnar.options */
|
||||
#define Natts_cstore_options 4
|
||||
#define Anum_cstore_options_regclass 1
|
||||
#define Anum_cstore_options_chunk_row_count 2
|
||||
|
@ -109,7 +109,7 @@ PG_FUNCTION_INFO_V1(columnar_relation_storageid);
|
|||
#define Anum_cstore_options_compression 4
|
||||
|
||||
/* ----------------
|
||||
* cstore.options definition.
|
||||
* columnar.options definition.
|
||||
* ----------------
|
||||
*/
|
||||
typedef struct FormData_cstore_options
|
||||
|
@ -162,7 +162,7 @@ InitColumnarOptions(Oid regclass)
|
|||
{
|
||||
/*
|
||||
* When upgrading we retain options for all columnar tables by upgrading
|
||||
* "cstore.options" catalog table, so we shouldn't do anything here.
|
||||
* "columnar.options" catalog table, so we shouldn't do anything here.
|
||||
*/
|
||||
if (IsBinaryUpgrade)
|
||||
{
|
||||
|
@ -1041,7 +1041,7 @@ ByteaToDatum(bytea *bytes, Form_pg_attribute attrForm)
|
|||
static Oid
|
||||
CStoreStripesRelationId(void)
|
||||
{
|
||||
return get_relname_relid("cstore_stripes", CStoreNamespaceId());
|
||||
return get_relname_relid("columnar_stripes", CStoreNamespaceId());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1052,12 +1052,12 @@ CStoreStripesRelationId(void)
|
|||
static Oid
|
||||
CStoreStripesIndexRelationId(void)
|
||||
{
|
||||
return get_relname_relid("cstore_stripes_pkey", CStoreNamespaceId());
|
||||
return get_relname_relid("columnar_stripes_pkey", CStoreNamespaceId());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ColumnarOptionsRelationId returns relation id of cstore.options.
|
||||
* ColumnarOptionsRelationId returns relation id of columnar.options.
|
||||
*/
|
||||
static Oid
|
||||
ColumnarOptionsRelationId(void)
|
||||
|
@ -1067,7 +1067,7 @@ ColumnarOptionsRelationId(void)
|
|||
|
||||
|
||||
/*
|
||||
* ColumnarOptionsIndexRegclass returns relation id of cstore.options_pkey.
|
||||
* ColumnarOptionsIndexRegclass returns relation id of columnar.options_pkey.
|
||||
*/
|
||||
static Oid
|
||||
ColumnarOptionsIndexRegclass(void)
|
||||
|
@ -1083,7 +1083,7 @@ ColumnarOptionsIndexRegclass(void)
|
|||
static Oid
|
||||
CStoreSkipNodesRelationId(void)
|
||||
{
|
||||
return get_relname_relid("cstore_skipnodes", CStoreNamespaceId());
|
||||
return get_relname_relid("columnar_skipnodes", CStoreNamespaceId());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ CStoreSkipNodesRelationId(void)
|
|||
static Oid
|
||||
CStoreSkipNodesIndexRelationId(void)
|
||||
{
|
||||
return get_relname_relid("cstore_skipnodes_pkey", CStoreNamespaceId());
|
||||
return get_relname_relid("columnar_skipnodes_pkey", CStoreNamespaceId());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1105,7 +1105,7 @@ CStoreSkipNodesIndexRelationId(void)
|
|||
static Oid
|
||||
CStoreNamespaceId(void)
|
||||
{
|
||||
return get_namespace_oid("cstore", false);
|
||||
return get_namespace_oid("columnar", false);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1462,7 +1462,7 @@ alter_columnar_table_set(PG_FUNCTION_ARGS)
|
|||
Relation rel = table_open(relationId, AccessExclusiveLock); /* ALTER TABLE LOCK */
|
||||
if (!IsCStoreTableAmTable(relationId))
|
||||
{
|
||||
ereport(ERROR, (errmsg("table %s is not a cstore table",
|
||||
ereport(ERROR, (errmsg("table %s is not a columnar table",
|
||||
quote_identifier(RelationGetRelationName(rel)))));
|
||||
}
|
||||
|
||||
|
@ -1552,7 +1552,7 @@ alter_columnar_table_reset(PG_FUNCTION_ARGS)
|
|||
Relation rel = table_open(relationId, AccessExclusiveLock); /* ALTER TABLE LOCK */
|
||||
if (!IsCStoreTableAmTable(relationId))
|
||||
{
|
||||
ereport(ERROR, (errmsg("table %s is not a cstore table",
|
||||
ereport(ERROR, (errmsg("table %s is not a columnar table",
|
||||
quote_identifier(RelationGetRelationName(rel)))));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* columnar--9.5-1--10.0-1.sql */
|
||||
|
||||
CREATE SCHEMA cstore;
|
||||
SET search_path TO cstore;
|
||||
CREATE SCHEMA columnar;
|
||||
SET search_path TO columnar;
|
||||
|
||||
CREATE SEQUENCE storageid_seq MINVALUE 10000000000 NO CYCLE;
|
||||
|
||||
|
@ -14,7 +14,7 @@ CREATE TABLE options (
|
|||
|
||||
COMMENT ON TABLE options IS 'columnar table specific options, maintained by alter_columnar_table_set';
|
||||
|
||||
CREATE TABLE cstore_stripes (
|
||||
CREATE TABLE columnar_stripes (
|
||||
storageid bigint NOT NULL,
|
||||
stripe bigint NOT NULL,
|
||||
file_offset bigint NOT NULL,
|
||||
|
@ -26,9 +26,9 @@ CREATE TABLE cstore_stripes (
|
|||
PRIMARY KEY (storageid, stripe)
|
||||
) WITH (user_catalog_table = true);
|
||||
|
||||
COMMENT ON TABLE cstore_stripes IS 'CStore per stripe metadata';
|
||||
COMMENT ON TABLE columnar_stripes IS 'Columnar per stripe metadata';
|
||||
|
||||
CREATE TABLE cstore_skipnodes (
|
||||
CREATE TABLE columnar_skipnodes (
|
||||
storageid bigint NOT NULL,
|
||||
stripe bigint NOT NULL,
|
||||
attr int NOT NULL,
|
||||
|
@ -43,10 +43,10 @@ CREATE TABLE cstore_skipnodes (
|
|||
value_compression_type int NOT NULL,
|
||||
value_decompressed_length bigint NOT NULL,
|
||||
PRIMARY KEY (storageid, stripe, attr, chunk),
|
||||
FOREIGN KEY (storageid, stripe) REFERENCES cstore_stripes(storageid, stripe) ON DELETE CASCADE
|
||||
FOREIGN KEY (storageid, stripe) REFERENCES columnar_stripes(storageid, stripe) ON DELETE CASCADE
|
||||
) WITH (user_catalog_table = true);
|
||||
|
||||
COMMENT ON TABLE cstore_skipnodes IS 'CStore per chunk metadata';
|
||||
COMMENT ON TABLE columnar_skipnodes IS 'Columnar per chunk metadata';
|
||||
|
||||
DO $proc$
|
||||
BEGIN
|
||||
|
@ -63,6 +63,6 @@ IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN
|
|||
END IF;
|
||||
END$proc$;
|
||||
|
||||
#include "udfs/cstore_ensure_objects_exist/10.0-1.sql"
|
||||
#include "udfs/columnar_ensure_objects_exist/10.0-1.sql"
|
||||
|
||||
RESET search_path;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* columnar--10.0-1--9.5-1.sql */
|
||||
|
||||
SET search_path TO cstore;
|
||||
SET search_path TO columnar;
|
||||
|
||||
DO $proc$
|
||||
BEGIN
|
||||
|
@ -27,12 +27,12 @@ IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN
|
|||
END IF;
|
||||
END$proc$;
|
||||
|
||||
DROP TABLE cstore_skipnodes;
|
||||
DROP TABLE cstore_stripes;
|
||||
DROP TABLE columnar_skipnodes;
|
||||
DROP TABLE columnar_stripes;
|
||||
DROP TABLE options;
|
||||
DROP SEQUENCE storageid_seq;
|
||||
|
||||
DROP FUNCTION citus_internal.cstore_ensure_objects_exist();
|
||||
DROP FUNCTION citus_internal.columnar_ensure_objects_exist();
|
||||
|
||||
RESET search_path;
|
||||
DROP SCHEMA cstore;
|
||||
DROP SCHEMA columnar;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- citus_internal.cstore_ensure_objects_exist is an internal helper function to create
|
||||
-- citus_internal.columnar_ensure_objects_exist is an internal helper function to create
|
||||
-- missing objects, anything related to the table access methods.
|
||||
-- Since the API for table access methods is only available in PG12 we can't create these
|
||||
-- objects when Citus is installed in PG11. Once citus is installed on PG11 the user can
|
||||
|
@ -6,7 +6,7 @@
|
|||
-- we couldn't create before.
|
||||
-- This internal function is called from `citus_finish_pg_upgrade` which the user is
|
||||
-- required to call after a PG major upgrade.
|
||||
CREATE OR REPLACE FUNCTION citus_internal.cstore_ensure_objects_exist()
|
||||
CREATE OR REPLACE FUNCTION citus_internal.columnar_ensure_objects_exist()
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
SET search_path = pg_catalog
|
||||
|
@ -25,7 +25,7 @@ IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'columnar') THEN
|
|||
#include "../alter_columnar_table_reset/10.0-1.sql"
|
||||
|
||||
-- add the missing objects to the extension
|
||||
ALTER EXTENSION citus ADD FUNCTION cstore.columnar_handler(internal);
|
||||
ALTER EXTENSION citus ADD FUNCTION columnar.columnar_handler(internal);
|
||||
ALTER EXTENSION citus ADD ACCESS METHOD columnar;
|
||||
ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_set(
|
||||
table_name regclass,
|
||||
|
@ -43,5 +43,5 @@ END IF;
|
|||
END;
|
||||
$ceoe$;
|
||||
|
||||
COMMENT ON FUNCTION citus_internal.cstore_ensure_objects_exist()
|
||||
COMMENT ON FUNCTION citus_internal.columnar_ensure_objects_exist()
|
||||
IS 'internal function to be called by pg_catalog.citus_finish_pg_upgrade responsible for creating the columnar objects';
|
|
@ -1,4 +1,4 @@
|
|||
-- citus_internal.cstore_ensure_objects_exist is an internal helper function to create
|
||||
-- citus_internal.columnar_ensure_objects_exist is an internal helper function to create
|
||||
-- missing objects, anything related to the table access methods.
|
||||
-- Since the API for table access methods is only available in PG12 we can't create these
|
||||
-- objects when Citus is installed in PG11. Once citus is installed on PG11 the user can
|
||||
|
@ -6,7 +6,7 @@
|
|||
-- we couldn't create before.
|
||||
-- This internal function is called from `citus_finish_pg_upgrade` which the user is
|
||||
-- required to call after a PG major upgrade.
|
||||
CREATE OR REPLACE FUNCTION citus_internal.cstore_ensure_objects_exist()
|
||||
CREATE OR REPLACE FUNCTION citus_internal.columnar_ensure_objects_exist()
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
SET search_path = pg_catalog
|
||||
|
@ -25,7 +25,7 @@ IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'columnar') THEN
|
|||
#include "../alter_columnar_table_reset/10.0-1.sql"
|
||||
|
||||
-- add the missing objects to the extension
|
||||
ALTER EXTENSION citus ADD FUNCTION cstore.columnar_handler(internal);
|
||||
ALTER EXTENSION citus ADD FUNCTION columnar.columnar_handler(internal);
|
||||
ALTER EXTENSION citus ADD ACCESS METHOD columnar;
|
||||
ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_set(
|
||||
table_name regclass,
|
||||
|
@ -43,5 +43,5 @@ END IF;
|
|||
END;
|
||||
$ceoe$;
|
||||
|
||||
COMMENT ON FUNCTION citus_internal.cstore_ensure_objects_exist()
|
||||
COMMENT ON FUNCTION citus_internal.columnar_ensure_objects_exist()
|
||||
IS 'internal function to be called by pg_catalog.citus_finish_pg_upgrade responsible for creating the columnar objects';
|
|
@ -1,9 +1,9 @@
|
|||
CREATE OR REPLACE FUNCTION cstore.columnar_handler(internal)
|
||||
CREATE OR REPLACE FUNCTION columnar.columnar_handler(internal)
|
||||
RETURNS table_am_handler
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'columnar_handler';
|
||||
|
||||
COMMENT ON FUNCTION cstore.columnar_handler(internal)
|
||||
IS 'internal function returning the handler for cstore tables';
|
||||
COMMENT ON FUNCTION columnar.columnar_handler(internal)
|
||||
IS 'internal function returning the handler for columnar tables';
|
||||
|
||||
CREATE ACCESS METHOD columnar TYPE TABLE HANDLER cstore.columnar_handler;
|
||||
CREATE ACCESS METHOD columnar TYPE TABLE HANDLER columnar.columnar_handler;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
CREATE OR REPLACE FUNCTION cstore.columnar_handler(internal)
|
||||
CREATE OR REPLACE FUNCTION columnar.columnar_handler(internal)
|
||||
RETURNS table_am_handler
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'columnar_handler';
|
||||
|
||||
COMMENT ON FUNCTION cstore.columnar_handler(internal)
|
||||
IS 'internal function returning the handler for cstore tables';
|
||||
COMMENT ON FUNCTION columnar.columnar_handler(internal)
|
||||
IS 'internal function returning the handler for columnar tables';
|
||||
|
||||
CREATE ACCESS METHOD columnar TYPE TABLE HANDLER cstore.columnar_handler;
|
||||
CREATE ACCESS METHOD columnar TYPE TABLE HANDLER columnar.columnar_handler;
|
||||
|
|
|
@ -108,7 +108,7 @@ BEGIN
|
|||
old_records naming,
|
||||
pg_get_object_address(naming.type, naming.object_names, naming.object_args) address;
|
||||
|
||||
PERFORM citus_internal.cstore_ensure_objects_exist();
|
||||
PERFORM citus_internal.columnar_ensure_objects_exist();
|
||||
END;
|
||||
$cppu$;
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ BEGIN
|
|||
old_records naming,
|
||||
pg_get_object_address(naming.type, naming.object_names, naming.object_args) address;
|
||||
|
||||
PERFORM citus_internal.cstore_ensure_objects_exist();
|
||||
PERFORM citus_internal.columnar_ensure_objects_exist();
|
||||
END;
|
||||
$cppu$;
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#define CSTORE_VERSION_MINOR 7
|
||||
|
||||
/* miscellaneous defines */
|
||||
#define CSTORE_FDW_NAME "cstore_fdw"
|
||||
#define CSTORE_TUPLE_COST_MULTIPLIER 10
|
||||
#define CSTORE_POSTSCRIPT_SIZE_LENGTH 1
|
||||
#define CSTORE_POSTSCRIPT_SIZE_MAX 256
|
||||
|
@ -63,7 +62,7 @@ typedef enum
|
|||
|
||||
|
||||
/*
|
||||
* CStoreFdwOptions holds the option values to be used when reading or writing
|
||||
* ColumnarOptions holds the option values to be used when reading or writing
|
||||
* a cstore file. To resolve these values, we first check foreign table's options,
|
||||
* and if not present, we then fall back to the default values specified above.
|
||||
*/
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef CSTORE_FDW_CSTORE_CUSTOMSCAN_H
|
||||
#define CSTORE_FDW_CSTORE_CUSTOMSCAN_H
|
||||
#ifndef COLUMNAR_CUSTOMSCAN_H
|
||||
#define COLUMNAR_CUSTOMSCAN_H
|
||||
|
||||
void cstore_customscan_init(void);
|
||||
|
||||
|
||||
#endif /*CSTORE_FDW_CSTORE_CUSTOMSCAN_H */
|
||||
#endif /* COLUMNAR_CUSTOMSCAN_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Test the CREATE statements related to cstore.
|
||||
-- Test the CREATE statements related to columnar.
|
||||
--
|
||||
-- Create uncompressed table
|
||||
CREATE TABLE contestant (handle TEXT, birthdate DATE, rating INT,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Tests the different DROP commands for cstore_fdw tables.
|
||||
-- Tests the different DROP commands for columnar tables.
|
||||
--
|
||||
-- DROP TABL
|
||||
-- DROP SCHEMA
|
||||
|
@ -7,30 +7,30 @@
|
|||
-- DROP DATABASE
|
||||
--
|
||||
-- Note that travis does not create
|
||||
-- cstore_fdw extension in default database (postgres). This has caused
|
||||
-- columnar extension in default database (postgres). This has caused
|
||||
-- different behavior between travis tests and local tests. Thus
|
||||
-- 'postgres' directory is excluded from comparison to have the same result.
|
||||
-- store postgres database oid
|
||||
SELECT oid postgres_oid FROM pg_database WHERE datname = 'postgres' \gset
|
||||
SELECT count(distinct storageid) AS cstore_stripes_before_drop FROM cstore.cstore_stripes \gset
|
||||
-- DROP cstore_fdw tables
|
||||
SELECT count(distinct storageid) AS columnar_stripes_before_drop FROM columnar.columnar_stripes \gset
|
||||
-- DROP columnar tables
|
||||
DROP TABLE contestant;
|
||||
DROP TABLE contestant_compressed;
|
||||
-- make sure DROP deletes metadata
|
||||
SELECT :cstore_stripes_before_drop - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_stripes_before_drop - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
2
|
||||
(1 row)
|
||||
|
||||
-- Create a cstore_fdw table under a schema and drop it.
|
||||
-- Create a columnar table under a schema and drop it.
|
||||
CREATE SCHEMA test_schema;
|
||||
CREATE TABLE test_schema.test_table(data int) USING columnar;
|
||||
INSERT INTO test_schema.test_table VALUES (1);
|
||||
SELECT count(*) AS cstore_stripes_before_drop FROM cstore.cstore_stripes \gset
|
||||
SELECT count(*) AS columnar_stripes_before_drop FROM columnar.columnar_stripes \gset
|
||||
DROP SCHEMA test_schema CASCADE;
|
||||
NOTICE: drop cascades to table test_schema.test_table
|
||||
SELECT :cstore_stripes_before_drop - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_stripes_before_drop - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
|
|
|
@ -23,7 +23,7 @@ SELECT alter_columnar_table_set('t_compressed', chunk_row_count => 100);
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT * FROM cstore.options WHERE regclass = 't_compressed'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
t_compressed | 100 | 100 | pglz
|
||||
|
|
|
@ -23,7 +23,7 @@ SELECT * FROM t_view a ORDER BY a;
|
|||
(3 rows)
|
||||
|
||||
-- show columnar options for materialized view
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -37,7 +37,7 @@ SELECT alter_columnar_table_set('t_view', compression => 'pglz');
|
|||
|
||||
(1 row)
|
||||
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -46,7 +46,7 @@ WHERE regclass = 't_view'::regclass;
|
|||
|
||||
REFRESH MATERIALIZED VIEW t_view;
|
||||
-- verify options have not been changed
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -67,13 +67,13 @@ SELECT * FROM t_view a ORDER BY a;
|
|||
-- verify that we have created metadata entries for the materialized view
|
||||
SELECT columnar_relation_storageid(oid) AS storageid
|
||||
FROM pg_class WHERE relname='t_view' \gset
|
||||
SELECT count(*) FROM cstore.cstore_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_stripes WHERE storageid=:storageid;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) FROM cstore.cstore_skipnodes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_skipnodes WHERE storageid=:storageid;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
3
|
||||
|
@ -82,13 +82,13 @@ SELECT count(*) FROM cstore.cstore_skipnodes WHERE storageid=:storageid;
|
|||
DROP TABLE t CASCADE;
|
||||
NOTICE: drop cascades to materialized view t_view
|
||||
-- dropping must remove metadata
|
||||
SELECT count(*) FROM cstore.cstore_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_stripes WHERE storageid=:storageid;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) FROM cstore.cstore_skipnodes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_skipnodes WHERE storageid=:storageid;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
|
|
|
@ -13,8 +13,8 @@ CREATE FUNCTION top_memory_context_usage()
|
|||
RETURNS BIGINT AS $$
|
||||
SELECT TopMemoryContext FROM column_store_memory_stats();
|
||||
$$ LANGUAGE SQL VOLATILE;
|
||||
SET cstore.stripe_row_count TO 50000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 50000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
CREATE TABLE t (a int, tag text, memusage bigint) USING columnar;
|
||||
-- measure memory before doing writes
|
||||
SELECT TopMemoryContext as top_pre,
|
||||
|
|
|
@ -11,7 +11,7 @@ $$ LANGUAGE SQL;
|
|||
INSERT INTO t2 SELECT i, f(i) FROM generate_series(1, 5) i;
|
||||
-- there are no subtransactions, so above statement should batch
|
||||
-- INSERTs inside the UDF and create on stripe per table.
|
||||
SELECT relname, count(*) FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT relname, count(*) FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE columnar_relation_storageid(b.oid)=a.storageid AND relname IN ('t1', 't2')
|
||||
GROUP BY relname
|
||||
ORDER BY relname;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
--
|
||||
CREATE TABLE t(a int, b int) USING columnar;
|
||||
CREATE VIEW t_stripes AS
|
||||
SELECT * FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT * FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname = 't';
|
||||
BEGIN;
|
||||
INSERT INTO t SELECT i, i+1 FROM generate_series(1, 10) i;
|
||||
|
|
|
@ -3,7 +3,7 @@ SET search_path TO am_tableoptions;
|
|||
CREATE TABLE table_options (a int) USING columnar;
|
||||
INSERT INTO table_options SELECT generate_series(1,100);
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -18,7 +18,7 @@ SELECT alter_columnar_table_set('table_options', compression => 'pglz');
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -33,7 +33,7 @@ SELECT alter_columnar_table_set('table_options', chunk_row_count => 10);
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -48,7 +48,7 @@ SELECT alter_columnar_table_set('table_options', stripe_row_count => 100);
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -58,7 +58,7 @@ WHERE regclass = 'table_options'::regclass;
|
|||
-- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming
|
||||
VACUUM FULL table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -73,7 +73,7 @@ SELECT alter_columnar_table_set('table_options', stripe_row_count => 1000, chunk
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -83,7 +83,7 @@ WHERE regclass = 'table_options'::regclass;
|
|||
-- make sure table options are not changed when VACUUM a table
|
||||
VACUUM table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -93,7 +93,7 @@ WHERE regclass = 'table_options'::regclass;
|
|||
-- make sure table options are not changed when VACUUM FULL a table
|
||||
VACUUM FULL table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -103,7 +103,7 @@ WHERE regclass = 'table_options'::regclass;
|
|||
-- make sure table options are not changed when truncating a table
|
||||
TRUNCATE table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -112,7 +112,7 @@ WHERE regclass = 'table_options'::regclass;
|
|||
|
||||
ALTER TABLE table_options ALTER COLUMN a TYPE bigint;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -120,12 +120,12 @@ WHERE regclass = 'table_options'::regclass;
|
|||
(1 row)
|
||||
|
||||
-- reset settings one by one to the version of the GUC's
|
||||
SET cstore.chunk_row_count TO 1000;
|
||||
SET cstore.stripe_row_count TO 10000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.chunk_row_count TO 1000;
|
||||
SET columnar.stripe_row_count TO 10000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
-- verify setting the GUC's didn't change the settings
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -139,7 +139,7 @@ SELECT alter_columnar_table_reset('table_options', chunk_row_count => true);
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -153,7 +153,7 @@ SELECT alter_columnar_table_reset('table_options', stripe_row_count => true);
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -167,7 +167,7 @@ SELECT alter_columnar_table_reset('table_options', compression => true);
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -175,11 +175,11 @@ WHERE regclass = 'table_options'::regclass;
|
|||
(1 row)
|
||||
|
||||
-- verify resetting all settings at once work
|
||||
SET cstore.chunk_row_count TO 10000;
|
||||
SET cstore.stripe_row_count TO 100000;
|
||||
SET cstore.compression TO 'none';
|
||||
SET columnar.chunk_row_count TO 10000;
|
||||
SET columnar.stripe_row_count TO 100000;
|
||||
SET columnar.compression TO 'none';
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -197,7 +197,7 @@ SELECT alter_columnar_table_reset(
|
|||
(1 row)
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
|
@ -205,19 +205,19 @@ WHERE regclass = 'table_options'::regclass;
|
|||
(1 row)
|
||||
|
||||
-- verify edge cases
|
||||
-- first start with a table that is not a cstore table
|
||||
CREATE TABLE not_a_cstore_table (a int);
|
||||
SELECT alter_columnar_table_set('not_a_cstore_table', compression => 'pglz');
|
||||
ERROR: table not_a_cstore_table is not a cstore table
|
||||
SELECT alter_columnar_table_reset('not_a_cstore_table', compression => true);
|
||||
ERROR: table not_a_cstore_table is not a cstore table
|
||||
-- first start with a table that is not a columnar table
|
||||
CREATE TABLE not_a_columnar_table (a int);
|
||||
SELECT alter_columnar_table_set('not_a_columnar_table', compression => 'pglz');
|
||||
ERROR: table not_a_columnar_table is not a columnar table
|
||||
SELECT alter_columnar_table_reset('not_a_columnar_table', compression => true);
|
||||
ERROR: table not_a_columnar_table is not a columnar table
|
||||
-- verify you can't use a compression that is not known
|
||||
SELECT alter_columnar_table_set('table_options', compression => 'foobar');
|
||||
ERROR: unknown compression type for cstore table: foobar
|
||||
-- verify options are removed when table is dropped
|
||||
DROP TABLE table_options;
|
||||
-- we expect no entries in çstore.options for anything not found int pg_class
|
||||
SELECT * FROM cstore.options o WHERE o.regclass NOT IN (SELECT oid FROM pg_class);
|
||||
SELECT * FROM columnar.options o WHERE o.regclass NOT IN (SELECT oid FROM pg_class);
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Test the TRUNCATE TABLE command for cstore_fdw tables.
|
||||
-- Test the TRUNCATE TABLE command for columnar tables.
|
||||
--
|
||||
-- print whether we're using version > 10 to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
|
@ -9,20 +9,20 @@ SELECT substring(:'server_version', '\d+')::int > 10 AS version_above_ten;
|
|||
t
|
||||
(1 row)
|
||||
|
||||
-- CREATE a cstore_fdw table, fill with some data --
|
||||
CREATE TABLE cstore_truncate_test (a int, b int) USING columnar;
|
||||
CREATE TABLE cstore_truncate_test_second (a int, b int) USING columnar;
|
||||
-- CREATE a columnar table, fill with some data --
|
||||
CREATE TABLE columnar_truncate_test (a int, b int) USING columnar;
|
||||
CREATE TABLE columnar_truncate_test_second (a int, b int) USING columnar;
|
||||
-- COMPRESSED
|
||||
CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING columnar;
|
||||
CREATE TABLE cstore_truncate_test_regular (a int, b int);
|
||||
SELECT count(distinct storageid) AS cstore_data_files_before_truncate FROM cstore.cstore_stripes \gset
|
||||
INSERT INTO cstore_truncate_test select a, a from generate_series(1, 10) a;
|
||||
set cstore.compression = 'pglz';
|
||||
INSERT INTO cstore_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO cstore_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
set cstore.compression to default;
|
||||
CREATE TABLE columnar_truncate_test_compressed (a int, b int) USING columnar;
|
||||
CREATE TABLE columnar_truncate_test_regular (a int, b int);
|
||||
SELECT count(distinct storageid) AS columnar_data_files_before_truncate FROM columnar.columnar_stripes \gset
|
||||
INSERT INTO columnar_truncate_test select a, a from generate_series(1, 10) a;
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO columnar_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO columnar_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
set columnar.compression to default;
|
||||
-- query rows
|
||||
SELECT * FROM cstore_truncate_test;
|
||||
SELECT * FROM columnar_truncate_test;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
1 | 1
|
||||
|
@ -37,41 +37,41 @@ SELECT * FROM cstore_truncate_test;
|
|||
10 | 10
|
||||
(10 rows)
|
||||
|
||||
TRUNCATE TABLE cstore_truncate_test;
|
||||
SELECT * FROM cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test;
|
||||
SELECT * FROM columnar_truncate_test;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
SELECT COUNT(*) from cstore_truncate_test;
|
||||
SELECT COUNT(*) from columnar_truncate_test;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) FROM cstore_truncate_test_compressed;
|
||||
SELECT count(*) FROM columnar_truncate_test_compressed;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
20
|
||||
(1 row)
|
||||
|
||||
TRUNCATE TABLE cstore_truncate_test_compressed;
|
||||
SELECT count(*) FROM cstore_truncate_test_compressed;
|
||||
TRUNCATE TABLE columnar_truncate_test_compressed;
|
||||
SELECT count(*) FROM columnar_truncate_test_compressed;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
SELECT pg_relation_size('cstore_truncate_test_compressed');
|
||||
SELECT pg_relation_size('columnar_truncate_test_compressed');
|
||||
pg_relation_size
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
INSERT INTO cstore_truncate_test select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO cstore_truncate_test_regular select a, a from generate_series(10, 20) a;
|
||||
INSERT INTO cstore_truncate_test_second select a, a from generate_series(20, 30) a;
|
||||
SELECT * from cstore_truncate_test;
|
||||
INSERT INTO columnar_truncate_test select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO columnar_truncate_test_regular select a, a from generate_series(10, 20) a;
|
||||
INSERT INTO columnar_truncate_test_second select a, a from generate_series(20, 30) a;
|
||||
SELECT * from columnar_truncate_test;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
1 | 1
|
||||
|
@ -86,7 +86,7 @@ SELECT * from cstore_truncate_test;
|
|||
10 | 10
|
||||
(10 rows)
|
||||
|
||||
SELECT * from cstore_truncate_test_second;
|
||||
SELECT * from columnar_truncate_test_second;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
20 | 20
|
||||
|
@ -102,7 +102,7 @@ SELECT * from cstore_truncate_test_second;
|
|||
30 | 30
|
||||
(11 rows)
|
||||
|
||||
SELECT * from cstore_truncate_test_regular;
|
||||
SELECT * from columnar_truncate_test_regular;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
10 | 10
|
||||
|
@ -120,34 +120,34 @@ SELECT * from cstore_truncate_test_regular;
|
|||
|
||||
-- make sure multi truncate works
|
||||
-- notice that the same table might be repeated
|
||||
TRUNCATE TABLE cstore_truncate_test,
|
||||
cstore_truncate_test_regular,
|
||||
cstore_truncate_test_second,
|
||||
cstore_truncate_test;
|
||||
SELECT * from cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test,
|
||||
columnar_truncate_test_regular,
|
||||
columnar_truncate_test_second,
|
||||
columnar_truncate_test;
|
||||
SELECT * from columnar_truncate_test;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
SELECT * from cstore_truncate_test_second;
|
||||
SELECT * from columnar_truncate_test_second;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
SELECT * from cstore_truncate_test_regular;
|
||||
SELECT * from columnar_truncate_test_regular;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
-- test if truncate on empty table works
|
||||
TRUNCATE TABLE cstore_truncate_test;
|
||||
SELECT * from cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test;
|
||||
SELECT * from columnar_truncate_test;
|
||||
a | b
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
-- make sure TRUNATE deletes metadata for old relfilenode
|
||||
SELECT :cstore_data_files_before_truncate - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_data_files_before_truncate - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
|
@ -155,19 +155,19 @@ SELECT :cstore_data_files_before_truncate - count(distinct storageid) FROM cstor
|
|||
|
||||
-- test if truncation in the same transaction that created the table works properly
|
||||
BEGIN;
|
||||
CREATE TABLE cstore_same_transaction_truncate(a int) USING columnar;
|
||||
INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(1, 100);
|
||||
TRUNCATE cstore_same_transaction_truncate;
|
||||
INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(20, 23);
|
||||
CREATE TABLE columnar_same_transaction_truncate(a int) USING columnar;
|
||||
INSERT INTO columnar_same_transaction_truncate SELECT * FROM generate_series(1, 100);
|
||||
TRUNCATE columnar_same_transaction_truncate;
|
||||
INSERT INTO columnar_same_transaction_truncate SELECT * FROM generate_series(20, 23);
|
||||
COMMIT;
|
||||
-- should output "1" for the newly created relation
|
||||
SELECT count(distinct storageid) - :cstore_data_files_before_truncate FROM cstore.cstore_stripes;
|
||||
SELECT count(distinct storageid) - :columnar_data_files_before_truncate FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
(1 row)
|
||||
|
||||
SELECT * FROM cstore_same_transaction_truncate;
|
||||
SELECT * FROM columnar_same_transaction_truncate;
|
||||
a
|
||||
---------------------------------------------------------------------
|
||||
20
|
||||
|
@ -176,38 +176,38 @@ SELECT * FROM cstore_same_transaction_truncate;
|
|||
23
|
||||
(4 rows)
|
||||
|
||||
DROP TABLE cstore_same_transaction_truncate;
|
||||
DROP TABLE columnar_same_transaction_truncate;
|
||||
-- test if a cached truncate from a pl/pgsql function works
|
||||
CREATE FUNCTION cstore_truncate_test_regular_func() RETURNS void AS $$
|
||||
CREATE FUNCTION columnar_truncate_test_regular_func() RETURNS void AS $$
|
||||
BEGIN
|
||||
INSERT INTO cstore_truncate_test_regular select a, a from generate_series(1, 10) a;
|
||||
TRUNCATE TABLE cstore_truncate_test_regular;
|
||||
INSERT INTO columnar_truncate_test_regular select a, a from generate_series(1, 10) a;
|
||||
TRUNCATE TABLE columnar_truncate_test_regular;
|
||||
END;$$
|
||||
LANGUAGE plpgsql;
|
||||
SELECT cstore_truncate_test_regular_func();
|
||||
cstore_truncate_test_regular_func
|
||||
SELECT columnar_truncate_test_regular_func();
|
||||
columnar_truncate_test_regular_func
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
-- the cached plans are used stating from the second call
|
||||
SELECT cstore_truncate_test_regular_func();
|
||||
cstore_truncate_test_regular_func
|
||||
SELECT columnar_truncate_test_regular_func();
|
||||
columnar_truncate_test_regular_func
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
DROP FUNCTION cstore_truncate_test_regular_func();
|
||||
DROP TABLE cstore_truncate_test, cstore_truncate_test_second;
|
||||
DROP TABLE cstore_truncate_test_regular;
|
||||
DROP TABLE cstore_truncate_test_compressed;
|
||||
DROP FUNCTION columnar_truncate_test_regular_func();
|
||||
DROP TABLE columnar_truncate_test, columnar_truncate_test_second;
|
||||
DROP TABLE columnar_truncate_test_regular;
|
||||
DROP TABLE columnar_truncate_test_compressed;
|
||||
-- test truncate with schema
|
||||
CREATE SCHEMA truncate_schema;
|
||||
-- COMPRESSED
|
||||
CREATE TABLE truncate_schema.truncate_tbl (id int) USING columnar;
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100);
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
SELECT COUNT(*) FROM truncate_schema.truncate_tbl;
|
||||
count
|
||||
---------------------------------------------------------------------
|
||||
|
@ -221,9 +221,9 @@ SELECT COUNT(*) FROM truncate_schema.truncate_tbl;
|
|||
0
|
||||
(1 row)
|
||||
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100);
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
-- create a user that can not truncate
|
||||
CREATE USER truncate_user;
|
||||
NOTICE: not propagating CREATE ROLE/USER commands to worker nodes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
SELECT count(distinct storageid) AS columnar_table_count FROM cstore.cstore_stripes \gset
|
||||
SELECT count(distinct storageid) AS columnar_table_count FROM columnar.columnar_stripes \gset
|
||||
CREATE TABLE t(a int, b int) USING columnar;
|
||||
CREATE VIEW t_stripes AS
|
||||
SELECT * FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT * FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t';
|
||||
SELECT count(*) FROM t_stripes;
|
||||
count
|
||||
|
@ -74,7 +74,7 @@ SELECT count(*) FROM t_stripes;
|
|||
-- VACUUM FULL doesn't reclaim dropped columns, but converts them to NULLs
|
||||
ALTER TABLE t DROP COLUMN a;
|
||||
SELECT stripe, attr, chunk, minimum_value IS NULL, maximum_value IS NULL
|
||||
FROM cstore.cstore_skipnodes a, pg_class b
|
||||
FROM columnar.columnar_skipnodes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER BY 1, 2, 3;
|
||||
stripe | attr | chunk | ?column? | ?column?
|
||||
---------------------------------------------------------------------
|
||||
|
@ -88,7 +88,7 @@ WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER B
|
|||
|
||||
VACUUM FULL t;
|
||||
SELECT stripe, attr, chunk, minimum_value IS NULL, maximum_value IS NULL
|
||||
FROM cstore.cstore_skipnodes a, pg_class b
|
||||
FROM columnar.columnar_skipnodes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER BY 1, 2, 3;
|
||||
stripe | attr | chunk | ?column? | ?column?
|
||||
---------------------------------------------------------------------
|
||||
|
@ -101,7 +101,7 @@ WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER B
|
|||
(6 rows)
|
||||
|
||||
-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM cstore.cstore_stripes;
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
1
|
||||
|
@ -241,16 +241,16 @@ chunk count: 8, containing data for dropped columns: 0, none compressed: 2, pglz
|
|||
DROP TABLE t;
|
||||
DROP VIEW t_stripes;
|
||||
-- Make sure we cleaned the metadata for t too
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM cstore.cstore_stripes;
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM columnar.columnar_stripes;
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
0
|
||||
(1 row)
|
||||
|
||||
-- A table with high compression ratio
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET cstore.stripe_row_count TO 1000000;
|
||||
SET cstore.chunk_row_count TO 100000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 1000000;
|
||||
SET columnar.chunk_row_count TO 100000;
|
||||
CREATE TABLE t(a int, b char, c text) USING columnar;
|
||||
INSERT INTO t SELECT 1, 'a', 'xyz' FROM generate_series(1, 1000000) i;
|
||||
VACUUM VERBOSE t;
|
||||
|
|
|
@ -15,7 +15,7 @@ SELECT create_distributed_table('table_option', 'a');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -34,7 +34,7 @@ SELECT alter_columnar_table_set('table_option', compression => 'pglz');
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -53,7 +53,7 @@ SELECT alter_columnar_table_reset('table_option', compression => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -66,7 +66,7 @@ $cmd$);
|
|||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -85,7 +85,7 @@ SELECT alter_columnar_table_set('table_option', chunk_row_count => 100);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -104,7 +104,7 @@ SELECT alter_columnar_table_reset('table_option', chunk_row_count => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -117,7 +117,7 @@ $cmd$);
|
|||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -136,7 +136,7 @@ SELECT alter_columnar_table_set('table_option', stripe_row_count => 100);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -155,7 +155,7 @@ SELECT alter_columnar_table_reset('table_option', stripe_row_count => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -184,7 +184,7 @@ SELECT create_distributed_table('table_option_2', 'a');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -208,7 +208,7 @@ SELECT create_distributed_table('table_option', 'a');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -231,7 +231,7 @@ SELECT alter_columnar_table_set('table_option', compression => 'pglz');
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -254,7 +254,7 @@ SELECT alter_columnar_table_reset('table_option', compression => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -271,7 +271,7 @@ $cmd$);
|
|||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -294,7 +294,7 @@ SELECT alter_columnar_table_set('table_option', chunk_row_count => 100);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -317,7 +317,7 @@ SELECT alter_columnar_table_reset('table_option', chunk_row_count => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -334,7 +334,7 @@ $cmd$);
|
|||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -357,7 +357,7 @@ SELECT alter_columnar_table_set('table_option', stripe_row_count => 100);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -380,7 +380,7 @@ SELECT alter_columnar_table_reset('table_option', stripe_row_count => true);
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -413,7 +413,7 @@ SELECT create_distributed_table('table_option_2', 'a');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -439,7 +439,7 @@ SELECT create_reference_table('table_option_reference');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -456,7 +456,7 @@ SELECT alter_columnar_table_set('table_option_reference', compression => 'pglz')
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -473,7 +473,7 @@ SELECT alter_columnar_table_reset('table_option_reference', compression => true)
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -484,7 +484,7 @@ $cmd$);
|
|||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -501,7 +501,7 @@ SELECT alter_columnar_table_set('table_option_reference', chunk_row_count => 100
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -518,7 +518,7 @@ SELECT alter_columnar_table_reset('table_option_reference', chunk_row_count => t
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -529,7 +529,7 @@ $cmd$);
|
|||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -546,7 +546,7 @@ SELECT alter_columnar_table_set('table_option_reference', stripe_row_count => 10
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -563,7 +563,7 @@ SELECT alter_columnar_table_reset('table_option_reference', stripe_row_count =>
|
|||
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
@ -590,7 +590,7 @@ SELECT create_reference_table('table_option_reference_2');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_reference_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
run_command_on_placements
|
||||
---------------------------------------------------------------------
|
||||
|
|
|
@ -90,7 +90,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
type | identity
|
||||
---------------------------------------------------------------------
|
||||
|
@ -481,13 +481,13 @@ SELECT * FROM print_extension_changes();
|
|||
| access method columnar
|
||||
| function alter_columnar_table_reset(regclass,boolean,boolean,boolean)
|
||||
| function alter_columnar_table_set(regclass,integer,integer,name)
|
||||
| function citus_internal.cstore_ensure_objects_exist()
|
||||
| function cstore.columnar_handler(internal)
|
||||
| schema cstore
|
||||
| sequence cstore.storageid_seq
|
||||
| table cstore.cstore_skipnodes
|
||||
| table cstore.cstore_stripes
|
||||
| table cstore.options
|
||||
| function citus_internal.columnar_ensure_objects_exist()
|
||||
| function columnar.columnar_handler(internal)
|
||||
| schema columnar
|
||||
| sequence columnar.storageid_seq
|
||||
| table columnar.columnar_skipnodes
|
||||
| table columnar.columnar_stripes
|
||||
| table columnar.options
|
||||
| view citus_tables
|
||||
(11 rows)
|
||||
|
||||
|
@ -507,7 +507,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
type | identity
|
||||
---------------------------------------------------------------------
|
||||
|
|
|
@ -90,7 +90,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
type | identity
|
||||
---------------------------------------------------------------------
|
||||
|
@ -478,12 +478,12 @@ ALTER EXTENSION citus UPDATE TO '10.0-1';
|
|||
SELECT * FROM print_extension_changes();
|
||||
previous_object | current_object
|
||||
---------------------------------------------------------------------
|
||||
| function citus_internal.cstore_ensure_objects_exist()
|
||||
| schema cstore
|
||||
| sequence cstore.storageid_seq
|
||||
| table cstore.cstore_skipnodes
|
||||
| table cstore.cstore_stripes
|
||||
| table cstore.options
|
||||
| function citus_internal.columnar_ensure_objects_exist()
|
||||
| schema columnar
|
||||
| sequence columnar.storageid_seq
|
||||
| table columnar.columnar_skipnodes
|
||||
| table columnar.columnar_stripes
|
||||
| table columnar.options
|
||||
| view citus_tables
|
||||
(7 rows)
|
||||
|
||||
|
@ -503,7 +503,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
type | identity
|
||||
---------------------------------------------------------------------
|
||||
|
|
|
@ -101,7 +101,7 @@ SELECT * FROM matview ORDER BY a;
|
|||
(2 rows)
|
||||
|
||||
-- test we retained options
|
||||
SELECT * FROM cstore.options WHERE regclass = 'test_options_1'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 'test_options_1'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
test_options_1 | 1000 | 5000 | pglz
|
||||
|
@ -121,7 +121,7 @@ SELECT count(*), sum(a), sum(b) FROM test_options_1;
|
|||
10000 | 50005000 | 45010
|
||||
(1 row)
|
||||
|
||||
SELECT * FROM cstore.options WHERE regclass = 'test_options_2'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 'test_options_2'::regclass;
|
||||
regclass | chunk_row_count | stripe_row_count | compression
|
||||
---------------------------------------------------------------------
|
||||
test_options_2 | 2000 | 6000 | none
|
||||
|
|
|
@ -115,9 +115,9 @@ SELECT :relfilenode_pre_alter <> :relfilenode_post_alter AS relfilenode_changed;
|
|||
--
|
||||
-- Test that we retain options
|
||||
--
|
||||
SET cstore.stripe_row_count TO 5000;
|
||||
SET cstore.chunk_row_count TO 1000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 5000;
|
||||
SET columnar.chunk_row_count TO 1000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
CREATE TABLE test_options_1(a int, b int) USING columnar;
|
||||
INSERT INTO test_options_1 SELECT i, floor(i/1000) FROM generate_series(1, 10000) i;
|
||||
CREATE TABLE test_options_2(a int, b int) USING columnar;
|
||||
|
|
|
@ -36,7 +36,7 @@ ORDER BY 1;
|
|||
function citus_executor_name(integer)
|
||||
function citus_extradata_container(internal)
|
||||
function citus_finish_pg_upgrade()
|
||||
function citus_internal.cstore_ensure_objects_exist()
|
||||
function citus_internal.columnar_ensure_objects_exist()
|
||||
function citus_internal.find_groupid_for_node(text,integer)
|
||||
function citus_internal.pg_dist_node_trigger_func()
|
||||
function citus_internal.pg_dist_rebalance_strategy_enterprise_check()
|
||||
|
@ -72,6 +72,7 @@ ORDER BY 1;
|
|||
function citus_worker_stat_activity()
|
||||
function column_name_to_column(regclass,text)
|
||||
function column_to_column_name(regclass,text)
|
||||
function columnar.columnar_handler(internal)
|
||||
function coord_combine_agg(oid,cstring,anyelement)
|
||||
function coord_combine_agg_ffunc(internal,oid,cstring,anyelement)
|
||||
function coord_combine_agg_sfunc(internal,oid,cstring,anyelement)
|
||||
|
@ -80,7 +81,6 @@ ORDER BY 1;
|
|||
function create_distributed_table(regclass,text,citus.distribution_type,text)
|
||||
function create_intermediate_result(text,text)
|
||||
function create_reference_table(regclass)
|
||||
function cstore.columnar_handler(internal)
|
||||
function distributed_tables_colocated(regclass,regclass)
|
||||
function dump_global_wait_edges()
|
||||
function dump_local_wait_edges()
|
||||
|
@ -184,17 +184,17 @@ ORDER BY 1;
|
|||
function worker_save_query_explain_analyze(text,jsonb)
|
||||
schema citus
|
||||
schema citus_internal
|
||||
schema cstore
|
||||
sequence cstore.storageid_seq
|
||||
schema columnar
|
||||
sequence columnar.storageid_seq
|
||||
sequence pg_dist_colocationid_seq
|
||||
sequence pg_dist_groupid_seq
|
||||
sequence pg_dist_node_nodeid_seq
|
||||
sequence pg_dist_placement_placementid_seq
|
||||
sequence pg_dist_shardid_seq
|
||||
table citus.pg_dist_object
|
||||
table cstore.cstore_skipnodes
|
||||
table cstore.cstore_stripes
|
||||
table cstore.options
|
||||
table columnar.columnar_skipnodes
|
||||
table columnar.columnar_stripes
|
||||
table columnar.options
|
||||
table pg_dist_authinfo
|
||||
table pg_dist_colocation
|
||||
table pg_dist_local_group
|
||||
|
|
|
@ -33,7 +33,7 @@ ORDER BY 1;
|
|||
function citus_executor_name(integer)
|
||||
function citus_extradata_container(internal)
|
||||
function citus_finish_pg_upgrade()
|
||||
function citus_internal.cstore_ensure_objects_exist()
|
||||
function citus_internal.columnar_ensure_objects_exist()
|
||||
function citus_internal.find_groupid_for_node(text,integer)
|
||||
function citus_internal.pg_dist_node_trigger_func()
|
||||
function citus_internal.pg_dist_rebalance_strategy_enterprise_check()
|
||||
|
@ -180,17 +180,17 @@ ORDER BY 1;
|
|||
function worker_save_query_explain_analyze(text,jsonb)
|
||||
schema citus
|
||||
schema citus_internal
|
||||
schema cstore
|
||||
sequence cstore.storageid_seq
|
||||
schema columnar
|
||||
sequence columnar.storageid_seq
|
||||
sequence pg_dist_colocationid_seq
|
||||
sequence pg_dist_groupid_seq
|
||||
sequence pg_dist_node_nodeid_seq
|
||||
sequence pg_dist_placement_placementid_seq
|
||||
sequence pg_dist_shardid_seq
|
||||
table citus.pg_dist_object
|
||||
table cstore.cstore_skipnodes
|
||||
table cstore.cstore_stripes
|
||||
table cstore.options
|
||||
table columnar.columnar_skipnodes
|
||||
table columnar.columnar_stripes
|
||||
table columnar.options
|
||||
table pg_dist_authinfo
|
||||
table pg_dist_colocation
|
||||
table pg_dist_local_group
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--
|
||||
-- Test chunk filtering in cstore_fdw using min/max values in stripe skip lists.
|
||||
-- Test chunk filtering in columnar using min/max values in stripe skip lists.
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- filtered_row_count returns number of rows filtered by the WHERE clause.
|
||||
-- If chunks get filtered by cstore_fdw, less rows are passed to WHERE
|
||||
-- If chunks get filtered by columnar, less rows are passed to WHERE
|
||||
-- clause, so this function should return a lower number.
|
||||
--
|
||||
CREATE OR REPLACE FUNCTION filtered_row_count (query text) RETURNS bigint AS
|
||||
|
@ -29,8 +29,8 @@ $$ LANGUAGE PLPGSQL;
|
|||
|
||||
-- Create and load data
|
||||
-- chunk_row_count '1000', stripe_row_count '2000'
|
||||
set cstore.stripe_row_count = 2000;
|
||||
set cstore.chunk_row_count = 1000;
|
||||
set columnar.stripe_row_count = 2000;
|
||||
set columnar.chunk_row_count = 1000;
|
||||
CREATE TABLE test_chunk_filtering (a int)
|
||||
USING columnar;
|
||||
|
||||
|
@ -58,8 +58,8 @@ SELECT filtered_row_count('SELECT count(*) FROM test_chunk_filtering WHERE a < 2
|
|||
SELECT filtered_row_count('SELECT count(*) FROM test_chunk_filtering WHERE a < 0');
|
||||
SELECT filtered_row_count('SELECT count(*) FROM test_chunk_filtering WHERE a BETWEEN 990 AND 2010');
|
||||
|
||||
set cstore.stripe_row_count to default;
|
||||
set cstore.chunk_row_count to default;
|
||||
set columnar.stripe_row_count to default;
|
||||
set columnar.chunk_row_count to default;
|
||||
|
||||
-- Verify that we are fine with collations which use a different alphabet order
|
||||
CREATE TABLE collation_chunk_filtering_test(A text collate "da_DK")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Test loading data into cstore_fdw tables.
|
||||
-- Test loading data into columnar tables.
|
||||
--
|
||||
|
||||
-- COPY with incorrect delimiter
|
||||
|
@ -16,13 +16,13 @@ COPY contestant FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV;
|
|||
COPY contestant FROM PROGRAM 'cat @abs_srcdir@/data/contestants.2.csv' WITH CSV;
|
||||
|
||||
-- COPY into compressed table
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
COPY contestant_compressed FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV;
|
||||
|
||||
-- COPY into uncompressed table from program
|
||||
COPY contestant_compressed FROM PROGRAM 'cat @abs_srcdir@/data/contestants.2.csv'
|
||||
WITH CSV;
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
|
||||
-- Test column list
|
||||
CREATE TABLE famous_constants (id int, name text, value real)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
--
|
||||
-- Test chunk filtering in cstore_fdw using min/max values in stripe skip lists.
|
||||
-- Test chunk filtering in columnar using min/max values in stripe skip lists.
|
||||
--
|
||||
--
|
||||
-- filtered_row_count returns number of rows filtered by the WHERE clause.
|
||||
-- If chunks get filtered by cstore_fdw, less rows are passed to WHERE
|
||||
-- If chunks get filtered by columnar, less rows are passed to WHERE
|
||||
-- clause, so this function should return a lower number.
|
||||
--
|
||||
CREATE OR REPLACE FUNCTION filtered_row_count (query text) RETURNS bigint AS
|
||||
|
@ -25,8 +25,8 @@ $$
|
|||
$$ LANGUAGE PLPGSQL;
|
||||
-- Create and load data
|
||||
-- chunk_row_count '1000', stripe_row_count '2000'
|
||||
set cstore.stripe_row_count = 2000;
|
||||
set cstore.chunk_row_count = 1000;
|
||||
set columnar.stripe_row_count = 2000;
|
||||
set columnar.chunk_row_count = 1000;
|
||||
CREATE TABLE test_chunk_filtering (a int)
|
||||
USING columnar;
|
||||
COPY test_chunk_filtering FROM '@abs_srcdir@/data/chunk_filtering.csv' WITH CSV;
|
||||
|
@ -106,8 +106,8 @@ SELECT filtered_row_count('SELECT count(*) FROM test_chunk_filtering WHERE a BET
|
|||
3958
|
||||
(1 row)
|
||||
|
||||
set cstore.stripe_row_count to default;
|
||||
set cstore.chunk_row_count to default;
|
||||
set columnar.stripe_row_count to default;
|
||||
set columnar.chunk_row_count to default;
|
||||
-- Verify that we are fine with collations which use a different alphabet order
|
||||
CREATE TABLE collation_chunk_filtering_test(A text collate "da_DK")
|
||||
USING columnar;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Test loading data into cstore_fdw tables.
|
||||
-- Test loading data into columnar tables.
|
||||
--
|
||||
-- COPY with incorrect delimiter
|
||||
COPY contestant FROM '@abs_srcdir@/data/contestants.1.csv'
|
||||
|
@ -15,12 +15,12 @@ COPY contestant FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV;
|
|||
-- COPY into uncompressed table from program
|
||||
COPY contestant FROM PROGRAM 'cat @abs_srcdir@/data/contestants.2.csv' WITH CSV;
|
||||
-- COPY into compressed table
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
COPY contestant_compressed FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV;
|
||||
-- COPY into uncompressed table from program
|
||||
COPY contestant_compressed FROM PROGRAM 'cat @abs_srcdir@/data/contestants.2.csv'
|
||||
WITH CSV;
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
-- Test column list
|
||||
CREATE TABLE famous_constants (id int, name text, value real)
|
||||
USING columnar;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Test the CREATE statements related to cstore.
|
||||
-- Test the CREATE statements related to columnar.
|
||||
--
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- Tests the different DROP commands for cstore_fdw tables.
|
||||
-- Tests the different DROP commands for columnar tables.
|
||||
--
|
||||
-- DROP TABL
|
||||
-- DROP SCHEMA
|
||||
|
@ -8,30 +8,30 @@
|
|||
--
|
||||
|
||||
-- Note that travis does not create
|
||||
-- cstore_fdw extension in default database (postgres). This has caused
|
||||
-- columnar extension in default database (postgres). This has caused
|
||||
-- different behavior between travis tests and local tests. Thus
|
||||
-- 'postgres' directory is excluded from comparison to have the same result.
|
||||
|
||||
-- store postgres database oid
|
||||
SELECT oid postgres_oid FROM pg_database WHERE datname = 'postgres' \gset
|
||||
|
||||
SELECT count(distinct storageid) AS cstore_stripes_before_drop FROM cstore.cstore_stripes \gset
|
||||
SELECT count(distinct storageid) AS columnar_stripes_before_drop FROM columnar.columnar_stripes \gset
|
||||
|
||||
-- DROP cstore_fdw tables
|
||||
-- DROP columnar tables
|
||||
DROP TABLE contestant;
|
||||
DROP TABLE contestant_compressed;
|
||||
|
||||
-- make sure DROP deletes metadata
|
||||
SELECT :cstore_stripes_before_drop - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_stripes_before_drop - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
|
||||
-- Create a cstore_fdw table under a schema and drop it.
|
||||
-- Create a columnar table under a schema and drop it.
|
||||
CREATE SCHEMA test_schema;
|
||||
CREATE TABLE test_schema.test_table(data int) USING columnar;
|
||||
INSERT INTO test_schema.test_table VALUES (1);
|
||||
|
||||
SELECT count(*) AS cstore_stripes_before_drop FROM cstore.cstore_stripes \gset
|
||||
SELECT count(*) AS columnar_stripes_before_drop FROM columnar.columnar_stripes \gset
|
||||
DROP SCHEMA test_schema CASCADE;
|
||||
SELECT :cstore_stripes_before_drop - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_stripes_before_drop - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
|
||||
SELECT current_database() datname \gset
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ SELECT alter_columnar_table_set('t_compressed', compression => 'pglz');
|
|||
SELECT alter_columnar_table_set('t_compressed', stripe_row_count => 100);
|
||||
SELECT alter_columnar_table_set('t_compressed', chunk_row_count => 100);
|
||||
|
||||
SELECT * FROM cstore.options WHERE regclass = 't_compressed'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 't_compressed'::regclass;
|
||||
|
||||
-- select
|
||||
select * from t_uncompressed;
|
||||
|
|
|
@ -16,18 +16,18 @@ INSERT INTO t SELECT floor(i / 4), 2 * i FROM generate_series(11, 20) i;
|
|||
SELECT * FROM t_view a ORDER BY a;
|
||||
|
||||
-- show columnar options for materialized view
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
|
||||
-- show we can set options on a materialized view
|
||||
SELECT alter_columnar_table_set('t_view', compression => 'pglz');
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
|
||||
REFRESH MATERIALIZED VIEW t_view;
|
||||
|
||||
-- verify options have not been changed
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 't_view'::regclass;
|
||||
|
||||
SELECT * FROM t_view a ORDER BY a;
|
||||
|
@ -36,11 +36,11 @@ SELECT * FROM t_view a ORDER BY a;
|
|||
SELECT columnar_relation_storageid(oid) AS storageid
|
||||
FROM pg_class WHERE relname='t_view' \gset
|
||||
|
||||
SELECT count(*) FROM cstore.cstore_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM cstore.cstore_skipnodes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_skipnodes WHERE storageid=:storageid;
|
||||
|
||||
DROP TABLE t CASCADE;
|
||||
|
||||
-- dropping must remove metadata
|
||||
SELECT count(*) FROM cstore.cstore_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM cstore.cstore_skipnodes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_stripes WHERE storageid=:storageid;
|
||||
SELECT count(*) FROM columnar.columnar_skipnodes WHERE storageid=:storageid;
|
||||
|
|
|
@ -17,8 +17,8 @@ CREATE FUNCTION top_memory_context_usage()
|
|||
SELECT TopMemoryContext FROM column_store_memory_stats();
|
||||
$$ LANGUAGE SQL VOLATILE;
|
||||
|
||||
SET cstore.stripe_row_count TO 50000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 50000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
CREATE TABLE t (a int, tag text, memusage bigint) USING columnar;
|
||||
|
||||
-- measure memory before doing writes
|
||||
|
|
|
@ -15,7 +15,7 @@ INSERT INTO t2 SELECT i, f(i) FROM generate_series(1, 5) i;
|
|||
|
||||
-- there are no subtransactions, so above statement should batch
|
||||
-- INSERTs inside the UDF and create on stripe per table.
|
||||
SELECT relname, count(*) FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT relname, count(*) FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE columnar_relation_storageid(b.oid)=a.storageid AND relname IN ('t1', 't2')
|
||||
GROUP BY relname
|
||||
ORDER BY relname;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
CREATE TABLE t(a int, b int) USING columnar;
|
||||
|
||||
CREATE VIEW t_stripes AS
|
||||
SELECT * FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT * FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname = 't';
|
||||
|
||||
BEGIN;
|
||||
|
|
|
@ -5,101 +5,101 @@ CREATE TABLE table_options (a int) USING columnar;
|
|||
INSERT INTO table_options SELECT generate_series(1,100);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- test changing the compression
|
||||
SELECT alter_columnar_table_set('table_options', compression => 'pglz');
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- test changing the chunk_row_count
|
||||
SELECT alter_columnar_table_set('table_options', chunk_row_count => 10);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- test changing the chunk_row_count
|
||||
SELECT alter_columnar_table_set('table_options', stripe_row_count => 100);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming
|
||||
VACUUM FULL table_options;
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- set all settings at the same time
|
||||
SELECT alter_columnar_table_set('table_options', stripe_row_count => 1000, chunk_row_count => 100, compression => 'none');
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- make sure table options are not changed when VACUUM a table
|
||||
VACUUM table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- make sure table options are not changed when VACUUM FULL a table
|
||||
VACUUM FULL table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- make sure table options are not changed when truncating a table
|
||||
TRUNCATE table_options;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
ALTER TABLE table_options ALTER COLUMN a TYPE bigint;
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- reset settings one by one to the version of the GUC's
|
||||
SET cstore.chunk_row_count TO 1000;
|
||||
SET cstore.stripe_row_count TO 10000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.chunk_row_count TO 1000;
|
||||
SET columnar.stripe_row_count TO 10000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
|
||||
-- verify setting the GUC's didn't change the settings
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
SELECT alter_columnar_table_reset('table_options', chunk_row_count => true);
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
SELECT alter_columnar_table_reset('table_options', stripe_row_count => true);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
SELECT alter_columnar_table_reset('table_options', compression => true);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- verify resetting all settings at once work
|
||||
SET cstore.chunk_row_count TO 10000;
|
||||
SET cstore.stripe_row_count TO 100000;
|
||||
SET cstore.compression TO 'none';
|
||||
SET columnar.chunk_row_count TO 10000;
|
||||
SET columnar.stripe_row_count TO 100000;
|
||||
SET columnar.compression TO 'none';
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
SELECT alter_columnar_table_reset(
|
||||
|
@ -109,14 +109,14 @@ SELECT alter_columnar_table_reset(
|
|||
compression => true);
|
||||
|
||||
-- show table_options settings
|
||||
SELECT * FROM cstore.options
|
||||
SELECT * FROM columnar.options
|
||||
WHERE regclass = 'table_options'::regclass;
|
||||
|
||||
-- verify edge cases
|
||||
-- first start with a table that is not a cstore table
|
||||
CREATE TABLE not_a_cstore_table (a int);
|
||||
SELECT alter_columnar_table_set('not_a_cstore_table', compression => 'pglz');
|
||||
SELECT alter_columnar_table_reset('not_a_cstore_table', compression => true);
|
||||
-- first start with a table that is not a columnar table
|
||||
CREATE TABLE not_a_columnar_table (a int);
|
||||
SELECT alter_columnar_table_set('not_a_columnar_table', compression => 'pglz');
|
||||
SELECT alter_columnar_table_reset('not_a_columnar_table', compression => true);
|
||||
|
||||
-- verify you can't use a compression that is not known
|
||||
SELECT alter_columnar_table_set('table_options', compression => 'foobar');
|
||||
|
@ -124,7 +124,7 @@ SELECT alter_columnar_table_set('table_options', compression => 'foobar');
|
|||
-- verify options are removed when table is dropped
|
||||
DROP TABLE table_options;
|
||||
-- we expect no entries in çstore.options for anything not found int pg_class
|
||||
SELECT * FROM cstore.options o WHERE o.regclass NOT IN (SELECT oid FROM pg_class);
|
||||
SELECT * FROM columnar.options o WHERE o.regclass NOT IN (SELECT oid FROM pg_class);
|
||||
|
||||
SET client_min_messages TO warning;
|
||||
DROP SCHEMA am_tableoptions CASCADE;
|
||||
|
|
|
@ -1,116 +1,116 @@
|
|||
--
|
||||
-- Test the TRUNCATE TABLE command for cstore_fdw tables.
|
||||
-- Test the TRUNCATE TABLE command for columnar tables.
|
||||
--
|
||||
|
||||
-- print whether we're using version > 10 to make version-specific tests clear
|
||||
SHOW server_version \gset
|
||||
SELECT substring(:'server_version', '\d+')::int > 10 AS version_above_ten;
|
||||
|
||||
-- CREATE a cstore_fdw table, fill with some data --
|
||||
CREATE TABLE cstore_truncate_test (a int, b int) USING columnar;
|
||||
CREATE TABLE cstore_truncate_test_second (a int, b int) USING columnar;
|
||||
-- CREATE a columnar table, fill with some data --
|
||||
CREATE TABLE columnar_truncate_test (a int, b int) USING columnar;
|
||||
CREATE TABLE columnar_truncate_test_second (a int, b int) USING columnar;
|
||||
-- COMPRESSED
|
||||
CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING columnar;
|
||||
CREATE TABLE cstore_truncate_test_regular (a int, b int);
|
||||
CREATE TABLE columnar_truncate_test_compressed (a int, b int) USING columnar;
|
||||
CREATE TABLE columnar_truncate_test_regular (a int, b int);
|
||||
|
||||
SELECT count(distinct storageid) AS cstore_data_files_before_truncate FROM cstore.cstore_stripes \gset
|
||||
SELECT count(distinct storageid) AS columnar_data_files_before_truncate FROM columnar.columnar_stripes \gset
|
||||
|
||||
INSERT INTO cstore_truncate_test select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO columnar_truncate_test select a, a from generate_series(1, 10) a;
|
||||
|
||||
set cstore.compression = 'pglz';
|
||||
INSERT INTO cstore_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO cstore_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
set cstore.compression to default;
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO columnar_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO columnar_truncate_test_compressed select a, a from generate_series(1, 10) a;
|
||||
set columnar.compression to default;
|
||||
|
||||
-- query rows
|
||||
SELECT * FROM cstore_truncate_test;
|
||||
SELECT * FROM columnar_truncate_test;
|
||||
|
||||
TRUNCATE TABLE cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test;
|
||||
|
||||
SELECT * FROM cstore_truncate_test;
|
||||
SELECT * FROM columnar_truncate_test;
|
||||
|
||||
SELECT COUNT(*) from cstore_truncate_test;
|
||||
SELECT COUNT(*) from columnar_truncate_test;
|
||||
|
||||
SELECT count(*) FROM cstore_truncate_test_compressed;
|
||||
TRUNCATE TABLE cstore_truncate_test_compressed;
|
||||
SELECT count(*) FROM cstore_truncate_test_compressed;
|
||||
SELECT count(*) FROM columnar_truncate_test_compressed;
|
||||
TRUNCATE TABLE columnar_truncate_test_compressed;
|
||||
SELECT count(*) FROM columnar_truncate_test_compressed;
|
||||
|
||||
SELECT pg_relation_size('cstore_truncate_test_compressed');
|
||||
SELECT pg_relation_size('columnar_truncate_test_compressed');
|
||||
|
||||
INSERT INTO cstore_truncate_test select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO cstore_truncate_test_regular select a, a from generate_series(10, 20) a;
|
||||
INSERT INTO cstore_truncate_test_second select a, a from generate_series(20, 30) a;
|
||||
INSERT INTO columnar_truncate_test select a, a from generate_series(1, 10) a;
|
||||
INSERT INTO columnar_truncate_test_regular select a, a from generate_series(10, 20) a;
|
||||
INSERT INTO columnar_truncate_test_second select a, a from generate_series(20, 30) a;
|
||||
|
||||
SELECT * from cstore_truncate_test;
|
||||
SELECT * from columnar_truncate_test;
|
||||
|
||||
SELECT * from cstore_truncate_test_second;
|
||||
SELECT * from columnar_truncate_test_second;
|
||||
|
||||
SELECT * from cstore_truncate_test_regular;
|
||||
SELECT * from columnar_truncate_test_regular;
|
||||
|
||||
-- make sure multi truncate works
|
||||
-- notice that the same table might be repeated
|
||||
TRUNCATE TABLE cstore_truncate_test,
|
||||
cstore_truncate_test_regular,
|
||||
cstore_truncate_test_second,
|
||||
cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test,
|
||||
columnar_truncate_test_regular,
|
||||
columnar_truncate_test_second,
|
||||
columnar_truncate_test;
|
||||
|
||||
SELECT * from cstore_truncate_test;
|
||||
SELECT * from cstore_truncate_test_second;
|
||||
SELECT * from cstore_truncate_test_regular;
|
||||
SELECT * from columnar_truncate_test;
|
||||
SELECT * from columnar_truncate_test_second;
|
||||
SELECT * from columnar_truncate_test_regular;
|
||||
|
||||
-- test if truncate on empty table works
|
||||
TRUNCATE TABLE cstore_truncate_test;
|
||||
SELECT * from cstore_truncate_test;
|
||||
TRUNCATE TABLE columnar_truncate_test;
|
||||
SELECT * from columnar_truncate_test;
|
||||
|
||||
-- make sure TRUNATE deletes metadata for old relfilenode
|
||||
SELECT :cstore_data_files_before_truncate - count(distinct storageid) FROM cstore.cstore_stripes;
|
||||
SELECT :columnar_data_files_before_truncate - count(distinct storageid) FROM columnar.columnar_stripes;
|
||||
|
||||
-- test if truncation in the same transaction that created the table works properly
|
||||
BEGIN;
|
||||
CREATE TABLE cstore_same_transaction_truncate(a int) USING columnar;
|
||||
INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(1, 100);
|
||||
TRUNCATE cstore_same_transaction_truncate;
|
||||
INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(20, 23);
|
||||
CREATE TABLE columnar_same_transaction_truncate(a int) USING columnar;
|
||||
INSERT INTO columnar_same_transaction_truncate SELECT * FROM generate_series(1, 100);
|
||||
TRUNCATE columnar_same_transaction_truncate;
|
||||
INSERT INTO columnar_same_transaction_truncate SELECT * FROM generate_series(20, 23);
|
||||
COMMIT;
|
||||
|
||||
-- should output "1" for the newly created relation
|
||||
SELECT count(distinct storageid) - :cstore_data_files_before_truncate FROM cstore.cstore_stripes;
|
||||
SELECT * FROM cstore_same_transaction_truncate;
|
||||
SELECT count(distinct storageid) - :columnar_data_files_before_truncate FROM columnar.columnar_stripes;
|
||||
SELECT * FROM columnar_same_transaction_truncate;
|
||||
|
||||
DROP TABLE cstore_same_transaction_truncate;
|
||||
DROP TABLE columnar_same_transaction_truncate;
|
||||
|
||||
-- test if a cached truncate from a pl/pgsql function works
|
||||
CREATE FUNCTION cstore_truncate_test_regular_func() RETURNS void AS $$
|
||||
CREATE FUNCTION columnar_truncate_test_regular_func() RETURNS void AS $$
|
||||
BEGIN
|
||||
INSERT INTO cstore_truncate_test_regular select a, a from generate_series(1, 10) a;
|
||||
TRUNCATE TABLE cstore_truncate_test_regular;
|
||||
INSERT INTO columnar_truncate_test_regular select a, a from generate_series(1, 10) a;
|
||||
TRUNCATE TABLE columnar_truncate_test_regular;
|
||||
END;$$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
SELECT cstore_truncate_test_regular_func();
|
||||
SELECT columnar_truncate_test_regular_func();
|
||||
-- the cached plans are used stating from the second call
|
||||
SELECT cstore_truncate_test_regular_func();
|
||||
DROP FUNCTION cstore_truncate_test_regular_func();
|
||||
SELECT columnar_truncate_test_regular_func();
|
||||
DROP FUNCTION columnar_truncate_test_regular_func();
|
||||
|
||||
DROP TABLE cstore_truncate_test, cstore_truncate_test_second;
|
||||
DROP TABLE cstore_truncate_test_regular;
|
||||
DROP TABLE cstore_truncate_test_compressed;
|
||||
DROP TABLE columnar_truncate_test, columnar_truncate_test_second;
|
||||
DROP TABLE columnar_truncate_test_regular;
|
||||
DROP TABLE columnar_truncate_test_compressed;
|
||||
|
||||
-- test truncate with schema
|
||||
CREATE SCHEMA truncate_schema;
|
||||
-- COMPRESSED
|
||||
CREATE TABLE truncate_schema.truncate_tbl (id int) USING columnar;
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100);
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
SELECT COUNT(*) FROM truncate_schema.truncate_tbl;
|
||||
|
||||
TRUNCATE TABLE truncate_schema.truncate_tbl;
|
||||
SELECT COUNT(*) FROM truncate_schema.truncate_tbl;
|
||||
|
||||
set cstore.compression = 'pglz';
|
||||
set columnar.compression = 'pglz';
|
||||
INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100);
|
||||
set cstore.compression to default;
|
||||
set columnar.compression to default;
|
||||
-- create a user that can not truncate
|
||||
CREATE USER truncate_user;
|
||||
GRANT USAGE ON SCHEMA truncate_schema TO truncate_user;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
SELECT count(distinct storageid) AS columnar_table_count FROM cstore.cstore_stripes \gset
|
||||
SELECT count(distinct storageid) AS columnar_table_count FROM columnar.columnar_stripes \gset
|
||||
|
||||
CREATE TABLE t(a int, b int) USING columnar;
|
||||
|
||||
CREATE VIEW t_stripes AS
|
||||
SELECT * FROM cstore.cstore_stripes a, pg_class b
|
||||
SELECT * FROM columnar.columnar_stripes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t';
|
||||
|
||||
SELECT count(*) FROM t_stripes;
|
||||
|
@ -37,17 +37,17 @@ SELECT count(*) FROM t_stripes;
|
|||
ALTER TABLE t DROP COLUMN a;
|
||||
|
||||
SELECT stripe, attr, chunk, minimum_value IS NULL, maximum_value IS NULL
|
||||
FROM cstore.cstore_skipnodes a, pg_class b
|
||||
FROM columnar.columnar_skipnodes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER BY 1, 2, 3;
|
||||
|
||||
VACUUM FULL t;
|
||||
|
||||
SELECT stripe, attr, chunk, minimum_value IS NULL, maximum_value IS NULL
|
||||
FROM cstore.cstore_skipnodes a, pg_class b
|
||||
FROM columnar.columnar_skipnodes a, pg_class b
|
||||
WHERE a.storageid = columnar_relation_storageid(b.oid) AND b.relname='t' ORDER BY 1, 2, 3;
|
||||
|
||||
-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM cstore.cstore_stripes;
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM columnar.columnar_stripes;
|
||||
|
||||
-- do this in a transaction so concurrent autovacuum doesn't interfere with results
|
||||
BEGIN;
|
||||
|
@ -110,12 +110,12 @@ DROP TABLE t;
|
|||
DROP VIEW t_stripes;
|
||||
|
||||
-- Make sure we cleaned the metadata for t too
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM cstore.cstore_stripes;
|
||||
SELECT count(distinct storageid) - :columnar_table_count FROM columnar.columnar_stripes;
|
||||
|
||||
-- A table with high compression ratio
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET cstore.stripe_row_count TO 1000000;
|
||||
SET cstore.chunk_row_count TO 100000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 1000000;
|
||||
SET columnar.chunk_row_count TO 100000;
|
||||
CREATE TABLE t(a int, b char, c text) USING columnar;
|
||||
INSERT INTO t SELECT 1, 'a', 'xyz' FROM generate_series(1, 1000000) i;
|
||||
|
||||
|
|
|
@ -13,55 +13,55 @@ SELECT create_distributed_table('table_option', 'a');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', compression => 'pglz');
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', compression => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', chunk_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', chunk_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', stripe_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', stripe_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- verify settings are propagated when creating a table
|
||||
|
@ -74,7 +74,7 @@ SELECT create_distributed_table('table_option_2', 'a');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
DROP TABLE table_option, table_option_2;
|
||||
|
@ -89,55 +89,55 @@ SELECT create_distributed_table('table_option', 'a');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', compression => 'pglz');
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', compression => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', chunk_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', chunk_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option', stripe_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option', stripe_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- verify settings are propagated when creating a table
|
||||
|
@ -150,7 +150,7 @@ SELECT create_distributed_table('table_option_2', 'a');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
DROP TABLE table_option, table_option_2;
|
||||
|
@ -162,55 +162,55 @@ SELECT create_reference_table('table_option_reference');
|
|||
-- setting: compression
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option_reference', compression => 'pglz');
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option_reference', compression => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT compression FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT compression FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: chunk_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option_reference', chunk_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option_reference', chunk_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT chunk_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT chunk_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- setting: stripe_row_count
|
||||
-- get baseline for setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- change setting
|
||||
SELECT alter_columnar_table_set('table_option_reference', stripe_row_count => 100);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
-- reset setting
|
||||
SELECT alter_columnar_table_reset('table_option_reference', stripe_row_count => true);
|
||||
-- verify setting
|
||||
SELECT run_command_on_placements('table_option_reference',$cmd$
|
||||
SELECT stripe_row_count FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT stripe_row_count FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
-- verify settings are propagated when creating a table
|
||||
|
@ -223,7 +223,7 @@ SELECT create_reference_table('table_option_reference_2');
|
|||
|
||||
-- verify settings on placements
|
||||
SELECT run_command_on_placements('table_option_reference_2',$cmd$
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM cstore.options WHERE regclass = '%s'::regclass;
|
||||
SELECT ROW(chunk_row_count, stripe_row_count, compression) FROM columnar.options WHERE regclass = '%s'::regclass;
|
||||
$cmd$);
|
||||
|
||||
DROP TABLE table_option_reference, table_option_reference_2;
|
||||
|
|
|
@ -88,7 +88,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
|
||||
|
||||
|
@ -244,7 +244,7 @@ FROM pg_depend AS pgd,
|
|||
WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||
pgd.refobjid = pge.oid AND
|
||||
pge.extname = 'citus' AND
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'cstore')
|
||||
pgio.schema NOT IN ('pg_catalog', 'citus', 'citus_internal', 'test', 'columnar')
|
||||
ORDER BY 1, 2;
|
||||
|
||||
-- see incompatible version errors out
|
||||
|
|
|
@ -31,11 +31,11 @@ SELECT * FROM test_alter_type ORDER BY a;
|
|||
SELECT * FROM matview ORDER BY a;
|
||||
|
||||
-- test we retained options
|
||||
SELECT * FROM cstore.options WHERE regclass = 'test_options_1'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 'test_options_1'::regclass;
|
||||
VACUUM VERBOSE test_options_1;
|
||||
SELECT count(*), sum(a), sum(b) FROM test_options_1;
|
||||
|
||||
SELECT * FROM cstore.options WHERE regclass = 'test_options_2'::regclass;
|
||||
SELECT * FROM columnar.options WHERE regclass = 'test_options_2'::regclass;
|
||||
VACUUM VERBOSE test_options_2;
|
||||
SELECT count(*), sum(a), sum(b) FROM test_options_2;
|
||||
|
||||
|
|
|
@ -95,9 +95,9 @@ SELECT :relfilenode_pre_alter <> :relfilenode_post_alter AS relfilenode_changed;
|
|||
-- Test that we retain options
|
||||
--
|
||||
|
||||
SET cstore.stripe_row_count TO 5000;
|
||||
SET cstore.chunk_row_count TO 1000;
|
||||
SET cstore.compression TO 'pglz';
|
||||
SET columnar.stripe_row_count TO 5000;
|
||||
SET columnar.chunk_row_count TO 1000;
|
||||
SET columnar.compression TO 'pglz';
|
||||
|
||||
CREATE TABLE test_options_1(a int, b int) USING columnar;
|
||||
INSERT INTO test_options_1 SELECT i, floor(i/1000) FROM generate_series(1, 10000) i;
|
||||
|
|
Loading…
Reference in New Issue