mirror of https://github.com/citusdata/citus.git
add tests
parent
fd5cbcc7f8
commit
ef64fa89ce
|
@ -70,6 +70,7 @@ HINT: You can enable two-phase commit for extra safety with: SET citus.multi_sh
|
|||
CREATE INDEX lineitem_partkey_desc_index ON lineitem (l_partkey DESC);
|
||||
CREATE INDEX lineitem_partial_index ON lineitem (l_shipdate)
|
||||
WHERE l_shipdate < '1995-01-01';
|
||||
CREATE INDEX lineitem_colref_index ON lineitem (record_ne(lineitem.*, NULL));
|
||||
SET client_min_messages = ERROR; -- avoid version dependant warning about WAL
|
||||
CREATE INDEX lineitem_orderkey_hash_index ON lineitem USING hash (l_partkey);
|
||||
CREATE UNIQUE INDEX index_test_range_index_a ON index_test_range(a);
|
||||
|
@ -85,19 +86,20 @@ SELECT * FROM pg_indexes WHERE tablename = 'lineitem' or tablename like 'index_t
|
|||
public | index_test_hash | index_test_hash_index_a_b | | CREATE UNIQUE INDEX index_test_hash_index_a_b ON index_test_hash USING btree (a, b)
|
||||
public | index_test_range | index_test_range_index_a | | CREATE UNIQUE INDEX index_test_range_index_a ON index_test_range USING btree (a)
|
||||
public | index_test_range | index_test_range_index_a_b | | CREATE UNIQUE INDEX index_test_range_index_a_b ON index_test_range USING btree (a, b)
|
||||
public | lineitem | lineitem_colref_index | | CREATE INDEX lineitem_colref_index ON lineitem USING btree (record_ne(lineitem.*, NULL::record))
|
||||
public | lineitem | lineitem_orderkey_hash_index | | CREATE INDEX lineitem_orderkey_hash_index ON lineitem USING hash (l_partkey)
|
||||
public | lineitem | lineitem_orderkey_index | | CREATE INDEX lineitem_orderkey_index ON lineitem USING btree (l_orderkey)
|
||||
public | lineitem | lineitem_partial_index | | CREATE INDEX lineitem_partial_index ON lineitem USING btree (l_shipdate) WHERE (l_shipdate < '01-01-1995'::date)
|
||||
public | lineitem | lineitem_partkey_desc_index | | CREATE INDEX lineitem_partkey_desc_index ON lineitem USING btree (l_partkey DESC)
|
||||
public | lineitem | lineitem_pkey | | CREATE UNIQUE INDEX lineitem_pkey ON lineitem USING btree (l_orderkey, l_linenumber)
|
||||
public | lineitem | lineitem_time_index | | CREATE INDEX lineitem_time_index ON lineitem USING btree (l_shipdate)
|
||||
(10 rows)
|
||||
(11 rows)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
SELECT count(*) FROM pg_indexes WHERE tablename = (SELECT relname FROM pg_class WHERE relname LIKE 'lineitem%' ORDER BY relname LIMIT 1);
|
||||
count
|
||||
-------
|
||||
6
|
||||
7
|
||||
(1 row)
|
||||
|
||||
SELECT count(*) FROM pg_indexes WHERE tablename LIKE 'index_test_hash%';
|
||||
|
@ -161,13 +163,14 @@ SELECT * FROM pg_indexes WHERE tablename = 'lineitem' or tablename like 'index_t
|
|||
public | index_test_hash | index_test_hash_index_a_b | | CREATE UNIQUE INDEX index_test_hash_index_a_b ON index_test_hash USING btree (a, b)
|
||||
public | index_test_range | index_test_range_index_a | | CREATE UNIQUE INDEX index_test_range_index_a ON index_test_range USING btree (a)
|
||||
public | index_test_range | index_test_range_index_a_b | | CREATE UNIQUE INDEX index_test_range_index_a_b ON index_test_range USING btree (a, b)
|
||||
public | lineitem | lineitem_colref_index | | CREATE INDEX lineitem_colref_index ON lineitem USING btree (record_ne(lineitem.*, NULL::record))
|
||||
public | lineitem | lineitem_orderkey_hash_index | | CREATE INDEX lineitem_orderkey_hash_index ON lineitem USING hash (l_partkey)
|
||||
public | lineitem | lineitem_orderkey_index | | CREATE INDEX lineitem_orderkey_index ON lineitem USING btree (l_orderkey)
|
||||
public | lineitem | lineitem_partial_index | | CREATE INDEX lineitem_partial_index ON lineitem USING btree (l_shipdate) WHERE (l_shipdate < '01-01-1995'::date)
|
||||
public | lineitem | lineitem_partkey_desc_index | | CREATE INDEX lineitem_partkey_desc_index ON lineitem USING btree (l_partkey DESC)
|
||||
public | lineitem | lineitem_pkey | | CREATE UNIQUE INDEX lineitem_pkey ON lineitem USING btree (l_orderkey, l_linenumber)
|
||||
public | lineitem | lineitem_time_index | | CREATE INDEX lineitem_time_index ON lineitem USING btree (l_shipdate)
|
||||
(10 rows)
|
||||
(11 rows)
|
||||
|
||||
--
|
||||
-- DROP INDEX
|
||||
|
@ -183,6 +186,7 @@ ERROR: dropping indexes concurrently on distributed tables is currently unsuppo
|
|||
DROP INDEX lineitem_orderkey_index;
|
||||
DROP INDEX lineitem_partkey_desc_index;
|
||||
DROP INDEX lineitem_partial_index;
|
||||
DROP INDEX lineitem_colref_index;
|
||||
-- Verify that we handle if exists statements correctly
|
||||
DROP INDEX non_existent_index;
|
||||
ERROR: index "non_existent_index" does not exist
|
||||
|
|
|
@ -502,4 +502,20 @@ DEBUG: pruning merge fetch taskId 11
|
|||
DETAIL: Creating dependency on merge taskId 14
|
||||
ERROR: cannot use real time executor with repartition jobs
|
||||
HINT: Set citus.task_executor_type to "task-tracker".
|
||||
-- system columns from shard tables can be queried retrieved
|
||||
SELECT count(*) FROM (
|
||||
SELECT tableoid, ctid, cmin, cmax, xmin, xmax
|
||||
FROM articles
|
||||
WHERE tableoid IS NOT NULL OR
|
||||
ctid IS NOT NULL OR
|
||||
cmin IS NOT NULL OR
|
||||
cmax IS NOT NULL OR
|
||||
xmin IS NOT NULL OR
|
||||
xmax IS NOT NULL
|
||||
) x;
|
||||
count
|
||||
-------
|
||||
50
|
||||
(1 row)
|
||||
|
||||
SET client_min_messages to 'NOTICE';
|
||||
|
|
|
@ -43,6 +43,8 @@ CREATE INDEX lineitem_partkey_desc_index ON lineitem (l_partkey DESC);
|
|||
CREATE INDEX lineitem_partial_index ON lineitem (l_shipdate)
|
||||
WHERE l_shipdate < '1995-01-01';
|
||||
|
||||
CREATE INDEX lineitem_colref_index ON lineitem (record_ne(lineitem.*, NULL));
|
||||
|
||||
SET client_min_messages = ERROR; -- avoid version dependant warning about WAL
|
||||
CREATE INDEX lineitem_orderkey_hash_index ON lineitem USING hash (l_partkey);
|
||||
CREATE UNIQUE INDEX index_test_range_index_a ON index_test_range(a);
|
||||
|
@ -97,6 +99,7 @@ DROP INDEX CONCURRENTLY lineitem_orderkey_index;
|
|||
DROP INDEX lineitem_orderkey_index;
|
||||
DROP INDEX lineitem_partkey_desc_index;
|
||||
DROP INDEX lineitem_partial_index;
|
||||
DROP INDEX lineitem_colref_index;
|
||||
|
||||
-- Verify that we handle if exists statements correctly
|
||||
|
||||
|
|
|
@ -260,4 +260,16 @@ SELECT *
|
|||
FROM articles a, articles b
|
||||
WHERE a.id = b.id AND a.author_id = 1;
|
||||
|
||||
-- system columns from shard tables can be queried retrieved
|
||||
SELECT count(*) FROM (
|
||||
SELECT tableoid, ctid, cmin, cmax, xmin, xmax
|
||||
FROM articles
|
||||
WHERE tableoid IS NOT NULL OR
|
||||
ctid IS NOT NULL OR
|
||||
cmin IS NOT NULL OR
|
||||
cmax IS NOT NULL OR
|
||||
xmin IS NOT NULL OR
|
||||
xmax IS NOT NULL
|
||||
) x;
|
||||
|
||||
SET client_min_messages to 'NOTICE';
|
||||
|
|
Loading…
Reference in New Issue