Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ef6f11

Browse files
committed
Reduce running time of jsonb_sqljson test
The test created a 1m row table in order to test parallel operation ofJSON_VALUE. However, this was more than were needed for the test, sosave time by halving it, and also by making the table unlogged.Experimentation shows that this size is only a little above the numberrequired to generate the expected output.Per gripe from Andres FreundDiscussion:https://postgr.es/m/20220406022118.3ocqvhxr6kciw5am@alap3.anarazel.de
1 parent01effb1 commit2ef6f11

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎src/test/regress/expected/jsonb_sqljson.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,9 @@ ERROR: only string constants supported in JSON_TABLE path specification
20882088
LINE 1: SELECT * FROM JSON_TABLE(jsonb '{"a": 123}', '$' || '.' || '...
20892089
^
20902090
-- Test parallel JSON_VALUE()
2091-
CREATE TABLE test_parallel_jsonb_value AS
2091+
CREATEUNLOGGEDTABLE test_parallel_jsonb_value AS
20922092
SELECT i::text::jsonb AS js
2093-
FROM generate_series(1,1000000) i;
2093+
FROM generate_series(1,500000) i;
20942094
-- Should be non-parallel due to subtransactions
20952095
EXPLAIN (COSTS OFF)
20962096
SELECT sum(JSON_VALUE(js, '$' RETURNING numeric)) FROM test_parallel_jsonb_value;
@@ -2103,7 +2103,7 @@ SELECT sum(JSON_VALUE(js, '$' RETURNING numeric)) FROM test_parallel_jsonb_value
21032103
SELECT sum(JSON_VALUE(js, '$' RETURNING numeric)) FROM test_parallel_jsonb_value;
21042104
sum
21052105
--------------
2106-
500000500000
2106+
125000250000
21072107
(1 row)
21082108

21092109
-- Should be parallel
@@ -2121,6 +2121,6 @@ SELECT sum(JSON_VALUE(js, '$' RETURNING numeric ERROR ON ERROR)) FROM test_paral
21212121
SELECT sum(JSON_VALUE(js, '$' RETURNING numeric ERROR ON ERROR)) FROM test_parallel_jsonb_value;
21222122
sum
21232123
--------------
2124-
500000500000
2124+
125000250000
21252125
(1 row)
21262126

‎src/test/regress/sql/jsonb_sqljson.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,9 @@ SELECT JSON_QUERY(jsonb '{"a": 123}', 'error' || ' ' || 'error');
948948
SELECT*FROM JSON_TABLE(jsonb'{"a": 123}','$'||'.'||'a' COLUMNS (fooint));
949949

950950
-- Test parallel JSON_VALUE()
951-
CREATETABLEtest_parallel_jsonb_valueAS
951+
CREATEUNLOGGEDTABLE test_parallel_jsonb_valueAS
952952
SELECT i::text::jsonbAS js
953-
FROM generate_series(1,1000000) i;
953+
FROM generate_series(1,500000) i;
954954

955955
-- Should be non-parallel due to subtransactions
956956
EXPLAIN (COSTS OFF)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp