Re: Parallel safety of CURRENT_* family

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: 5bih4k+4jfl6m39j23k(at)guerrillamail(dot)com, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel safety of CURRENT_* family
Date: 2016-12-01 20:46:15
Message-ID: 12330.1480625175@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Dec 1, 2016 at 2:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> ... well, they would be if we passed down xactStartTimestamp to parallel
>> workers, but I can't find any code that does that. In view of the fact that
>> transaction_timestamp() is marked as parallel-safe, this is a bug in 9.6.

> Yeah. Do you think we should arrange to pass that down, or change the marking?

We can't fix the marking in existing 9.6 installations, so I think we
have to pass it down. (Which would be a better response anyway.)

Having said that, I find myself unable to reproduce a problem.
This should fail:

regression=# set parallel_setup_cost TO 0;
SET
regression=# set parallel_tuple_cost TO 0;
SET
regression=# set min_parallel_relation_size TO 0;
SET
regression=# set enable_indexscan TO 0;
SET
regression=# explain verbose select distinct transaction_timestamp() from tenk1;
QUERY PLAN
--------------------------------------------------------------------------------------
Unique (cost=0.00..424.67 rows=1 width=8)
Output: (transaction_timestamp())
-> Gather (cost=0.00..424.67 rows=10000 width=8)
Output: (transaction_timestamp())
Workers Planned: 2
-> Parallel Seq Scan on public.tenk1 (cost=0.00..410.08 rows=4167 width=8)
Output: transaction_timestamp()
(7 rows)

but it doesn't:

regression=# select distinct transaction_timestamp() from tenk1;
transaction_timestamp
-------------------------------
2016-12-01 15:44:12.839417-05
(1 row)

How is that happening?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-12-01 20:48:48 Re: Proposal: scan key push down to heap [WIP]
Previous Message Robert Haas 2016-12-01 20:46:04 Re: Broken SSL tests in master