Combine expand hypertable plan and result tests

This commit is contained in:
Sven Klemm 2019-03-20 19:24:55 +01:00 committed by Sven Klemm
parent 81b3b66d44
commit 75c0750952
8 changed files with 22 additions and 36 deletions

2
.gitignore vendored
View File

@ -21,7 +21,7 @@ typedef.list
/.vs
/test/sql/parallel-*.sql
/test/sql/plan_ordered_append-*.sql
/test/sql/plan_expand_hypertable_optimized-*.sql
/test/sql/plan_expand_hypertable-*.sql
/test/sql/plan_hashagg-*.sql
/test/sql/agg_bookends_optimized-*.sql
/test/sql/alternate_users-*.sql

View File

@ -1229,3 +1229,6 @@ SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, NULL);
:PREFIX SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[NULL::int]);
psql:include/plan_expand_hypertable_chunks_in_query.sql:38: ERROR: chunk id can't be NULL
\set ECHO errors
507
507

View File

@ -1231,3 +1231,6 @@ SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, NULL);
:PREFIX SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[NULL::int]);
psql:include/plan_expand_hypertable_chunks_in_query.sql:38: ERROR: chunk id can't be NULL
\set ECHO errors
507
507

View File

@ -1229,3 +1229,6 @@ SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, NULL);
:PREFIX SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[NULL::int]);
psql:include/plan_expand_hypertable_chunks_in_query.sql:38: ERROR: chunk id can't be NULL
\set ECHO errors
507
507

View File

@ -1,9 +0,0 @@
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
\set ECHO errors
?column?
----------
Done
(1 row)

View File

@ -39,7 +39,6 @@ set(TEST_FILES
pg_dump.sql
pg_dump_unprivileged.sql
plain.sql
plan_expand_hypertable_results_diff.sql
reindex.sql
relocate_extension.sql
reloptions.sql
@ -78,7 +77,6 @@ set(POST_TESTS
alternate_users-9.6
alternate_users-10
alternate_users-11
plan_expand_hypertable_results_diff
sql_query_results_x_diff
)
@ -131,7 +129,7 @@ set(TEST_TEMPLATES
alternate_users.sql.in
parallel.sql.in
partitioning.sql.in
plan_expand_hypertable_optimized.sql.in
plan_expand_hypertable.sql.in
#hashagg is different in 9.6 and 10 because of hashagg parallelism
plan_hashagg.sql.in
# lateral plans are different across versions, explains run without analyze on 9.6

View File

@ -2,6 +2,12 @@
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
SET timescaledb.disable_optimizations= 'off';
\set PREFIX 'EXPLAIN (costs off) '
\ir include/plan_expand_hypertable_load.sql
\ir include/plan_expand_hypertable_query.sql
\ir include/plan_expand_hypertable_chunks_in_query.sql
\set ECHO errors
\set TEST_BASE_NAME plan_expand_hypertable
SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
@ -11,18 +17,11 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
\gset
SELECT format('\! diff %s %s', :'TEST_RESULTS_OPTIMIZED', :'TEST_RESULTS_UNOPTIMIZED') as "DIFF_CMD"
\gset
-- use input redirect here because filenames are absolute and would be different across installations
SELECT format('\! wc -l <%s; wc -l <%s', :'TEST_RESULTS_OPTIMIZED', :'TEST_RESULTS_UNOPTIMIZED') as "WC_CMD"
\gset
\o /dev/null
SET client_min_messages = 'error';
\ir :TEST_LOAD_NAME
RESET client_min_messages;
\o
--generate the results into two different files
SET client_min_messages = 'error';
\set ECHO none
--make output contain query results
-- run queries with optimization on and off and diff results
\set PREFIX ''
\o :TEST_RESULTS_OPTIMIZED
SET timescaledb.disable_optimizations= 'off';
@ -32,8 +31,6 @@ SET timescaledb.disable_optimizations= 'off';
SET timescaledb.disable_optimizations= 'on';
\ir :TEST_QUERY_NAME
\o
RESET client_min_messages;
:DIFF_CMD
SELECT 'Done';
:WC_CMD

View File

@ -1,9 +0,0 @@
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
SET timescaledb.disable_optimizations= 'off';
\set PREFIX 'EXPLAIN (costs off) '
\ir include/plan_expand_hypertable_load.sql
\ir include/plan_expand_hypertable_query.sql
\ir include/plan_expand_hypertable_chunks_in_query.sql