Re: Inconsistency between pg_stat_activity and log_duration

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: amit(dot)kapila16(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inconsistency between pg_stat_activity and log_duration
Date: 2014-02-07 15:21:16
Message-ID: 11167.1391786476@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <ishii(at)postgresql(dot)org> writes:
>> The argument here could be do we really need a new state for such a short
>> window between completion of 'E' message and processing of 'S' sync
>> message considering updation of state is not a very light call which can
>> be called between processing of 2 messages. It might make sense for cases
>> where sync message processing can take longer time.

I concur with this objection --- we are not going to add reasons for
extended query mode to be slower than plain mode, especially not reasons
that are totally useless in normal usage.

> The query is piggy backed on the same connection to PostgreSQL opend
> by user (pgpool-II cannot issue "sync" because it closes the
> transaction, which in turn closes user's unnamed portal).

This argument (and usage) seems pretty broken. If you don't issue
sync then how do you know you've gotten all of the command's output?

If you're issuing a flush instead, maybe we could consider whether it's
reasonable to do an extra pgstat_report_activity() upon receipt of a
flush message. But -1 for putting it into the normal control flow.

I'd also vote against inventing a new pgstat state code for this.
Most people will never see it, which would prompt questions in itself.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-02-07 16:58:28 Re: open and close columns in the NEW record not allowed
Previous Message Heikki Linnakangas 2014-02-07 13:33:08 Re: GIN improvements part2: fast scan