Re: idle_in_transaction_timeout

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: idle_in_transaction_timeout
Date: 2014-06-29 19:48:15
Message-ID: 3333.1404071295@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 Sun, Jun 29, 2014 at 12:32 PM, Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
>> I propose to push this as it stands except for the postgres_fdw
>> part. The default is easy enough to change if we reach consensus,
>> and expanding the scope can be a new patch in a new CF.
>> Objections?

> Yeah, I think someone should do some analysis of whether this is
> adding gettimeofday() calls, and how many, and what the performance
> implications are.

I believe that as the patch stands, we'd incur one new gettimeofday()
per query-inside-a-transaction, inside the enable_timeout_after() call.
(I think the disable_timeout() call would not result in a gettimeofday
call, since there would be no remaining live timeout events.)

We could possibly refactor enough to share the clock reading with the call
done in pgstat_report_activity. Not sure how ugly that would be or
whether it's worth the trouble. Note that in the not-a-transaction-block
case, we already have got two gettimeofday calls in this sequence, one in
pgstat_report_stat and one in pgstat_report_activity :-(

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-06-29 20:13:50 Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]
Previous Message Dave McGuire 2014-06-29 19:44:22 Re: PostgreSQL for VAX on NetBSD/OpenBSD