mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
Attempt to fix broken regression test.
In commit 8c1d9d56e9a00680a035b8b333a98ea16b121eb7, I attempted to add a regression test that would fail if the target list was pushed into a parallel worker, but due to brain fade on my part, it just randomly fails whether anything bad or not, because the error check inside the parallel_restricted() function tests whether there is *any process in the system* that is not connected to a client, not whether the process running the query is not connected to a client. A little experimentation has left me pessimistic about the prospects of doing better here in a short amount of time, so let's just fall back to checking that the plan is as we expect and leave the execution-time check for another day.
This commit is contained in:
parent
4c56f3269a
commit
103512cee9
@ -1,14 +1,8 @@
|
|||||||
--
|
--
|
||||||
-- PARALLEL
|
-- PARALLEL
|
||||||
--
|
--
|
||||||
create or replace function parallel_restricted(int) returns int as $$
|
create or replace function parallel_restricted(int) returns int as
|
||||||
begin
|
$$begin return $1; end$$ language plpgsql parallel restricted;
|
||||||
perform * from pg_stat_activity where client_port is null;
|
|
||||||
if (found) then
|
|
||||||
raise 'parallel restricted function run in worker';
|
|
||||||
end if;
|
|
||||||
return $1;
|
|
||||||
end$$ language plpgsql parallel restricted;
|
|
||||||
-- Serializable isolation would disable parallel query, so explicitly use an
|
-- Serializable isolation would disable parallel query, so explicitly use an
|
||||||
-- arbitrary other level.
|
-- arbitrary other level.
|
||||||
begin isolation level repeatable read;
|
begin isolation level repeatable read;
|
||||||
@ -57,27 +51,6 @@ select parallel_restricted(unique1) from tenk1
|
|||||||
Filter: (tenk1.stringu1 = 'GRAAAA'::name)
|
Filter: (tenk1.stringu1 = 'GRAAAA'::name)
|
||||||
(9 rows)
|
(9 rows)
|
||||||
|
|
||||||
select parallel_restricted(unique1) from tenk1
|
|
||||||
where stringu1 = 'GRAAAA' order by 1;
|
|
||||||
parallel_restricted
|
|
||||||
---------------------
|
|
||||||
448
|
|
||||||
1124
|
|
||||||
1800
|
|
||||||
2476
|
|
||||||
3152
|
|
||||||
3828
|
|
||||||
4504
|
|
||||||
5180
|
|
||||||
5856
|
|
||||||
6532
|
|
||||||
7208
|
|
||||||
7884
|
|
||||||
8560
|
|
||||||
9236
|
|
||||||
9912
|
|
||||||
(15 rows)
|
|
||||||
|
|
||||||
set force_parallel_mode=1;
|
set force_parallel_mode=1;
|
||||||
explain (costs off)
|
explain (costs off)
|
||||||
select stringu1::int2 from tenk1 where unique1 = 1;
|
select stringu1::int2 from tenk1 where unique1 = 1;
|
||||||
|
@ -2,14 +2,8 @@
|
|||||||
-- PARALLEL
|
-- PARALLEL
|
||||||
--
|
--
|
||||||
|
|
||||||
create or replace function parallel_restricted(int) returns int as $$
|
create or replace function parallel_restricted(int) returns int as
|
||||||
begin
|
$$begin return $1; end$$ language plpgsql parallel restricted;
|
||||||
perform * from pg_stat_activity where client_port is null;
|
|
||||||
if (found) then
|
|
||||||
raise 'parallel restricted function run in worker';
|
|
||||||
end if;
|
|
||||||
return $1;
|
|
||||||
end$$ language plpgsql parallel restricted;
|
|
||||||
|
|
||||||
-- Serializable isolation would disable parallel query, so explicitly use an
|
-- Serializable isolation would disable parallel query, so explicitly use an
|
||||||
-- arbitrary other level.
|
-- arbitrary other level.
|
||||||
@ -29,8 +23,6 @@ alter table tenk1 set (parallel_workers = 4);
|
|||||||
explain (verbose, costs off)
|
explain (verbose, costs off)
|
||||||
select parallel_restricted(unique1) from tenk1
|
select parallel_restricted(unique1) from tenk1
|
||||||
where stringu1 = 'GRAAAA' order by 1;
|
where stringu1 = 'GRAAAA' order by 1;
|
||||||
select parallel_restricted(unique1) from tenk1
|
|
||||||
where stringu1 = 'GRAAAA' order by 1;
|
|
||||||
|
|
||||||
set force_parallel_mode=1;
|
set force_parallel_mode=1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user