mirror of https://github.com/citusdata/citus.git
63 lines
1.9 KiB
Plaintext
63 lines
1.9 KiB
Plaintext
--
|
|
-- Testing indexes on on columnar tables.
|
|
--
|
|
CREATE SCHEMA columnar_indexes;
|
|
SET search_path tO columnar_indexes, public;
|
|
--
|
|
-- create index with the concurrent option. We should
|
|
-- error out during index creation.
|
|
-- https://github.com/citusdata/citus/issues/4599
|
|
--
|
|
create table t(a int, b int) using columnar;
|
|
create index CONCURRENTLY t_idx on t(a, b);
|
|
ERROR: indexes not supported for columnar tables
|
|
\d t
|
|
Table "columnar_indexes.t"
|
|
Column | Type | Collation | Nullable | Default
|
|
---------------------------------------------------------------------
|
|
a | integer | | |
|
|
b | integer | | |
|
|
|
|
explain insert into t values (1, 2);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------
|
|
Insert on t (cost=0.00..0.01 rows=1 width=8)
|
|
-> Result (cost=0.00..0.01 rows=1 width=8)
|
|
(2 rows)
|
|
|
|
insert into t values (1, 2);
|
|
SELECT * FROM t;
|
|
a | b
|
|
---------------------------------------------------------------------
|
|
1 | 2
|
|
(1 row)
|
|
|
|
-- create index without the concurrent option. We should
|
|
-- error out during index creation.
|
|
create index t_idx on t(a, b);
|
|
ERROR: indexes not supported for columnar tables
|
|
\d t
|
|
Table "columnar_indexes.t"
|
|
Column | Type | Collation | Nullable | Default
|
|
---------------------------------------------------------------------
|
|
a | integer | | |
|
|
b | integer | | |
|
|
|
|
explain insert into t values (1, 2);
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------
|
|
Insert on t (cost=0.00..0.01 rows=1 width=8)
|
|
-> Result (cost=0.00..0.01 rows=1 width=8)
|
|
(2 rows)
|
|
|
|
insert into t values (3, 4);
|
|
SELECT * FROM t;
|
|
a | b
|
|
---------------------------------------------------------------------
|
|
1 | 2
|
|
3 | 4
|
|
(2 rows)
|
|
|
|
SET client_min_messages TO WARNING;
|
|
DROP SCHEMA columnar_indexes CASCADE;
|