mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Remove dynamic version checks from SQL tests
The sql tests still had version checks and would run EXPLAIN with different parameters depending on postgres version. Since all supported postgres versions now support all the parameters we use we can safely remove the version check.
This commit is contained in:
parent
b93b30b0c2
commit
157764c70e
@ -9,13 +9,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
-- This file and its contents are licensed under the Apache License 2.0.
|
-- This file and its contents are licensed under the Apache License 2.0.
|
||||||
-- Please see the included NOTICE for copyright information and
|
-- Please see the included NOTICE for copyright information and
|
||||||
|
@ -9,13 +9,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
-- This file and its contents are licensed under the Apache License 2.0.
|
-- This file and its contents are licensed under the Apache License 2.0.
|
||||||
-- Please see the included NOTICE for copyright information and
|
-- Please see the included NOTICE for copyright information and
|
||||||
|
@ -9,13 +9,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
-- This file and its contents are licensed under the Apache License 2.0.
|
-- This file and its contents are licensed under the Apache License 2.0.
|
||||||
-- Please see the included NOTICE for copyright information and
|
-- Please see the included NOTICE for copyright information and
|
||||||
|
@ -9,13 +9,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
-- This file and its contents are licensed under the Apache License 2.0.
|
-- This file and its contents are licensed under the Apache License 2.0.
|
||||||
-- Please see the included NOTICE for copyright information and
|
-- Please see the included NOTICE for copyright information and
|
||||||
|
@ -33,7 +33,7 @@ r INTEGER;
|
|||||||
BEGIN
|
BEGIN
|
||||||
FOR i in 1..10
|
FOR i in 1..10
|
||||||
LOOP
|
LOOP
|
||||||
SELECT COUNT(*) from worker_counts where (launcher = launcher_ct OR current_setting('server_version_num')::int < 100000)
|
SELECT COUNT(*) from worker_counts where launcher = launcher_ct
|
||||||
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
||||||
if(r < 1) THEN
|
if(r < 1) THEN
|
||||||
PERFORM pg_sleep(0.1);
|
PERFORM pg_sleep(0.1);
|
||||||
@ -317,11 +317,9 @@ SELECT backend_start as orig_backend_start
|
|||||||
FROM pg_stat_activity
|
FROM pg_stat_activity
|
||||||
WHERE application_name = 'TimescaleDB Background Worker Scheduler'
|
WHERE application_name = 'TimescaleDB Background Worker Scheduler'
|
||||||
AND datname = :'TEST_DBNAME_2' \gset
|
AND datname = :'TEST_DBNAME_2' \gset
|
||||||
SELECT coalesce(
|
SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name = 'TimescaleDB Background Worker Launcher';
|
||||||
(SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name = 'TimescaleDB Background Worker Launcher'),
|
pg_cancel_backend
|
||||||
(SELECT current_setting('server_version_num')::int < 100000));
|
-------------------
|
||||||
coalesce
|
|
||||||
----------
|
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
@ -331,7 +329,7 @@ SELECT wait_worker_counts(1,0,1,0);
|
|||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT ((current_setting('server_version_num')::int < 100000) OR wait_greater(:'orig_backend_start', :'TEST_DBNAME_2')) as wait_greater;
|
SELECT wait_greater(:'orig_backend_start', :'TEST_DBNAME_2');
|
||||||
wait_greater
|
wait_greater
|
||||||
--------------
|
--------------
|
||||||
t
|
t
|
||||||
@ -459,7 +457,7 @@ r INTEGER;
|
|||||||
BEGIN
|
BEGIN
|
||||||
FOR i in 1..10
|
FOR i in 1..10
|
||||||
LOOP
|
LOOP
|
||||||
SELECT COUNT(*) from worker_counts where (launcher = launcher_ct OR current_setting('server_version_num')::int < 100000)
|
SELECT COUNT(*) from worker_counts where launcher = launcher_ct
|
||||||
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
||||||
if(r < 1) THEN
|
if(r < 1) THEN
|
||||||
PERFORM pg_sleep(0.1);
|
PERFORM pg_sleep(0.1);
|
||||||
|
@ -14,15 +14,9 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
format('%s/results/%s_results_optimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_OPTIMIZED",
|
format('%s/results/%s_results_optimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_OPTIMIZED",
|
||||||
format('%s/results/%s_results_unoptimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_UNOPTIMIZED"
|
format('%s/results/%s_results_unoptimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_UNOPTIMIZED"
|
||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
\gset
|
||||||
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
\set PREFIX_NO_ANALYZE 'EXPLAIN (costs off)'
|
\set PREFIX_NO_ANALYZE 'EXPLAIN (costs off)'
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
-- This file and its contents are licensed under the Apache License 2.0.
|
-- This file and its contents are licensed under the Apache License 2.0.
|
||||||
|
@ -11,14 +11,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
\ir :TEST_QUERY_NAME
|
\ir :TEST_QUERY_NAME
|
||||||
|
|
||||||
|
@ -11,13 +11,7 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized results" --label "Optimized results" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
\ir :TEST_QUERY_NAME
|
\ir :TEST_QUERY_NAME
|
||||||
|
@ -146,13 +146,11 @@ FROM pg_stat_activity
|
|||||||
WHERE application_name = 'TimescaleDB Background Worker Scheduler'
|
WHERE application_name = 'TimescaleDB Background Worker Scheduler'
|
||||||
AND datname = :'TEST_DBNAME_2' \gset
|
AND datname = :'TEST_DBNAME_2' \gset
|
||||||
|
|
||||||
SELECT coalesce(
|
SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name = 'TimescaleDB Background Worker Launcher';
|
||||||
(SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name = 'TimescaleDB Background Worker Launcher'),
|
|
||||||
(SELECT current_setting('server_version_num')::int < 100000));
|
|
||||||
|
|
||||||
SELECT wait_worker_counts(1,0,1,0);
|
SELECT wait_worker_counts(1,0,1,0);
|
||||||
|
|
||||||
SELECT ((current_setting('server_version_num')::int < 100000) OR wait_greater(:'orig_backend_start', :'TEST_DBNAME_2')) as wait_greater;
|
SELECT wait_greater(:'orig_backend_start', :'TEST_DBNAME_2');
|
||||||
|
|
||||||
-- Make sure running pre_restore function stops background workers
|
-- Make sure running pre_restore function stops background workers
|
||||||
SELECT timescaledb_pre_restore();
|
SELECT timescaledb_pre_restore();
|
||||||
|
@ -21,7 +21,7 @@ r INTEGER;
|
|||||||
BEGIN
|
BEGIN
|
||||||
FOR i in 1..10
|
FOR i in 1..10
|
||||||
LOOP
|
LOOP
|
||||||
SELECT COUNT(*) from worker_counts where (launcher = launcher_ct OR current_setting('server_version_num')::int < 100000)
|
SELECT COUNT(*) from worker_counts where launcher = launcher_ct
|
||||||
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
AND single_scheduler = scheduler1_ct AND single_2_scheduler = scheduler2_ct and template1_scheduler = template1_ct into r;
|
||||||
if(r < 1) THEN
|
if(r < 1) THEN
|
||||||
PERFORM pg_sleep(0.1);
|
PERFORM pg_sleep(0.1);
|
||||||
|
@ -16,18 +16,10 @@ SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|||||||
format('%s/results/%s_results_optimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_OPTIMIZED",
|
format('%s/results/%s_results_optimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_OPTIMIZED",
|
||||||
format('%s/results/%s_results_unoptimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_UNOPTIMIZED"
|
format('%s/results/%s_results_unoptimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_UNOPTIMIZED"
|
||||||
\gset
|
\gset
|
||||||
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Unoptimized result" --label "Optimized result" %s %s', :'TEST_RESULTS_UNOPTIMIZED', :'TEST_RESULTS_OPTIMIZED') as "DIFF_CMD"
|
||||||
\gset
|
|
||||||
|
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
\gset
|
||||||
|
|
||||||
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
\set PREFIX_NO_ANALYZE 'EXPLAIN (costs off)'
|
\set PREFIX_NO_ANALYZE 'EXPLAIN (costs off)'
|
||||||
|
|
||||||
\ir :TEST_LOAD_NAME
|
\ir :TEST_LOAD_NAME
|
||||||
|
@ -10,13 +10,7 @@ SELECT _timescaledb_internal.stop_background_workers();
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
||||||
SELECT create_hypertable('metrics','time');
|
SELECT create_hypertable('metrics','time');
|
||||||
create_hypertable
|
create_hypertable
|
||||||
|
@ -10,13 +10,7 @@ SELECT _timescaledb_internal.stop_background_workers();
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
||||||
SELECT create_hypertable('metrics','time');
|
SELECT create_hypertable('metrics','time');
|
||||||
create_hypertable
|
create_hypertable
|
||||||
|
@ -127,17 +127,8 @@ ANALYZE metrics_space;
|
|||||||
\set PREFIX ''
|
\set PREFIX ''
|
||||||
\set PREFIX_VERBOSE ''
|
\set PREFIX_VERBOSE ''
|
||||||
\set ECHO none
|
\set ECHO none
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
SET max_parallel_workers_per_gather TO 0;
|
SET max_parallel_workers_per_gather TO 0;
|
||||||
@ -7735,17 +7726,8 @@ ORDER BY c.id;
|
|||||||
\set ECHO none
|
\set ECHO none
|
||||||
-- diff compressed and uncompressed results
|
-- diff compressed and uncompressed results
|
||||||
:DIFF_CMD_IDX
|
:DIFF_CMD_IDX
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
SET max_parallel_workers_per_gather TO 0;
|
SET max_parallel_workers_per_gather TO 0;
|
||||||
|
@ -127,17 +127,8 @@ ANALYZE metrics_space;
|
|||||||
\set PREFIX ''
|
\set PREFIX ''
|
||||||
\set PREFIX_VERBOSE ''
|
\set PREFIX_VERBOSE ''
|
||||||
\set ECHO none
|
\set ECHO none
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
SET max_parallel_workers_per_gather TO 0;
|
SET max_parallel_workers_per_gather TO 0;
|
||||||
@ -7624,17 +7615,8 @@ ORDER BY c.id;
|
|||||||
\set ECHO none
|
\set ECHO none
|
||||||
-- diff compressed and uncompressed results
|
-- diff compressed and uncompressed results
|
||||||
:DIFF_CMD_IDX
|
:DIFF_CMD_IDX
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
SET max_parallel_workers_per_gather TO 0;
|
SET max_parallel_workers_per_gather TO 0;
|
||||||
|
@ -10,17 +10,8 @@ SELECT
|
|||||||
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- get EXPLAIN output for all variations
|
-- get EXPLAIN output for all variations
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
set work_mem to '64MB';
|
set work_mem to '64MB';
|
||||||
set max_parallel_workers_per_gather to 0;
|
set max_parallel_workers_per_gather to 0;
|
||||||
\set TEST_TABLE 'metrics'
|
\set TEST_TABLE 'metrics'
|
||||||
|
@ -9,17 +9,8 @@ SELECT
|
|||||||
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- get EXPLAIN output for all variations
|
-- get EXPLAIN output for all variations
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
set work_mem to '64MB';
|
set work_mem to '64MB';
|
||||||
set max_parallel_workers_per_gather to 0;
|
set max_parallel_workers_per_gather to 0;
|
||||||
\set TEST_TABLE 'metrics'
|
\set TEST_TABLE 'metrics'
|
||||||
|
@ -9,17 +9,8 @@ SELECT
|
|||||||
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed results" %s %s', :'TEST_RESULTS_UNCOMPRESSED', :'TEST_RESULTS_COMPRESSED') as "DIFF_CMD"
|
||||||
\gset
|
\gset
|
||||||
-- get EXPLAIN output for all variations
|
-- get EXPLAIN output for all variations
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
set work_mem to '64MB';
|
set work_mem to '64MB';
|
||||||
set max_parallel_workers_per_gather to 0;
|
set max_parallel_workers_per_gather to 0;
|
||||||
\set TEST_TABLE 'metrics'
|
\set TEST_TABLE 'metrics'
|
||||||
|
@ -12,17 +12,8 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
|
|||||||
\gset
|
\gset
|
||||||
|
|
||||||
-- get EXPLAIN output for all variations
|
-- get EXPLAIN output for all variations
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
set work_mem to '64MB';
|
set work_mem to '64MB';
|
||||||
|
|
||||||
|
@ -11,17 +11,8 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
|
|||||||
\gset
|
\gset
|
||||||
|
|
||||||
-- get EXPLAIN output for all variations
|
-- get EXPLAIN output for all variations
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
set work_mem to '64MB';
|
set work_mem to '64MB';
|
||||||
|
|
||||||
|
@ -7,14 +7,7 @@
|
|||||||
SELECT _timescaledb_internal.stop_background_workers();
|
SELECT _timescaledb_internal.stop_background_workers();
|
||||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
CREATE TABLE metrics(f1 int, f2 int, time timestamptz NOT NULL, device_id int, value float);
|
||||||
SELECT create_hypertable('metrics','time');
|
SELECT create_hypertable('metrics','time');
|
||||||
|
@ -113,17 +113,8 @@ SET client_min_messages TO error;
|
|||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
\set ECHO all
|
\set ECHO all
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
@ -201,17 +192,8 @@ RESET client_min_messages;
|
|||||||
:DIFF_CMD_IDX
|
:DIFF_CMD_IDX
|
||||||
|
|
||||||
|
|
||||||
-- look at postgres version to decide whether we run with analyze or without
|
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||||
SELECT
|
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
|
||||||
ELSE 'EXPLAIN (costs off)'
|
|
||||||
END AS "PREFIX",
|
|
||||||
CASE WHEN current_setting('server_version_num')::int >= 100000
|
|
||||||
THEN 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
|
||||||
ELSE 'EXPLAIN (costs off, verbose)'
|
|
||||||
END AS "PREFIX_VERBOSE"
|
|
||||||
\gset
|
|
||||||
|
|
||||||
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
-- we disable parallelism here otherwise EXPLAIN ANALYZE output
|
||||||
-- will be not stable and differ depending on worker assignment
|
-- will be not stable and differ depending on worker assignment
|
||||||
|
Loading…
x
Reference in New Issue
Block a user