I noticed that the fastpath code doesn't update ps_status, which would
be harmless except that it leads to "idle in transaction" being logged
in log_line_prefix for the command tag.

Are there objections to applying this?

--
Álvaro Herrera <alvherre@alvh.no-ip.org>

Search Discussions

  • Tom Lane at Dec 17, 2010 at 3:41 pm

    Alvaro Herrera writes:
    I noticed that the fastpath code doesn't update ps_status, which would
    be harmless except that it leads to "idle in transaction" being logged
    in log_line_prefix for the command tag.
    Are there objections to applying this?
    Hm, what about pgstat_report_activity()?

    Is anyone concerned about the added overhead for fastpath calls?

    regards, tom lane
  • Alvaro Herrera at Dec 17, 2010 at 7:20 pm

    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
    I noticed that the fastpath code doesn't update ps_status, which would
    be harmless except that it leads to "idle in transaction" being logged
    in log_line_prefix for the command tag.
    Are there objections to applying this?
    Hm, what about pgstat_report_activity()?
    I wasn't sure about that, because of the overhead, but now that I look
    at it, it's supposed to be cheaper than changing the ps_status in some
    cases, so I guess there's no harm.

    The other argument to support the case that this should be done is that
    the docs suggest that you should use prepared statements instead, which
    do have the reporting overhead.

    --
    Álvaro Herrera <alvherre@commandprompt.com>
    The PostgreSQL Company - Command Prompt, Inc.
    PostgreSQL Replication, Consulting, Custom Development, 24x7 support
  • Tom Lane at Dec 17, 2010 at 7:25 pm

    Alvaro Herrera writes:
    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Hm, what about pgstat_report_activity()?
    I wasn't sure about that, because of the overhead, but now that I look
    at it, it's supposed to be cheaper than changing the ps_status in some
    cases, so I guess there's no harm.
    Yeah, if we can afford a possible kernel call to set ps status, it
    doesn't seem like pgstat_report_activity should be a problem. I'm
    also of the opinion that more people look at pg_stat_activity than
    ps output these days.

    regards, tom lane
  • Alvaro Herrera at Dec 17, 2010 at 7:40 pm

    Excerpts from Tom Lane's message of vie dic 17 16:25:17 -0300 2010:
    Alvaro Herrera <alvherre@commandprompt.com> writes:
    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Hm, what about pgstat_report_activity()?
    I wasn't sure about that, because of the overhead, but now that I look
    at it, it's supposed to be cheaper than changing the ps_status in some
    cases, so I guess there's no harm.
    Yeah, if we can afford a possible kernel call to set ps status, it
    doesn't seem like pgstat_report_activity should be a problem. I'm
    also of the opinion that more people look at pg_stat_activity than
    ps output these days.
    Well, actually, if the functions are cheap, presumably they aren't going
    to stay for much time in either status report; what I'm after is fixing
    the log_line_prefix stuff (%i I think it is).

    --
    Álvaro Herrera <alvherre@commandprompt.com>
    The PostgreSQL Company - Command Prompt, Inc.
    PostgreSQL Replication, Consulting, Custom Development, 24x7 support
  • Alvaro Herrera at Dec 17, 2010 at 9:19 pm

    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
    I noticed that the fastpath code doesn't update ps_status, which would
    be harmless except that it leads to "idle in transaction" being logged
    in log_line_prefix for the command tag.
    Are there objections to applying this?
    Hm, what about pgstat_report_activity()?
    Just noticed that it's already handled in postgres.c, before calling
    HandleFunctionRequest. Probably not worth messing with.

    --
    Álvaro Herrera <alvherre@commandprompt.com>
    The PostgreSQL Company - Command Prompt, Inc.
    PostgreSQL Replication, Consulting, Custom Development, 24x7 support
  • Tom Lane at Dec 17, 2010 at 9:21 pm

    Alvaro Herrera writes:
    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Hm, what about pgstat_report_activity()?
    Just noticed that it's already handled in postgres.c, before calling
    HandleFunctionRequest. Probably not worth messing with.
    Ah. Well, the ps_status update should be adjacent to the other one,
    not off in some other module altogether.

    regards, tom lane
  • Alvaro Herrera at Dec 17, 2010 at 9:53 pm

    Excerpts from Tom Lane's message of vie dic 17 18:21:48 -0300 2010:
    Alvaro Herrera <alvherre@commandprompt.com> writes:
    Excerpts from Tom Lane's message of vie dic 17 12:41:06 -0300 2010:
    Hm, what about pgstat_report_activity()?
    Just noticed that it's already handled in postgres.c, before calling
    HandleFunctionRequest. Probably not worth messing with.
    Ah. Well, the ps_status update should be adjacent to the other one,
    not off in some other module altogether.
    Agreed -- committed that way.

    --
    Álvaro Herrera <alvherre@commandprompt.com>
    The PostgreSQL Company - Command Prompt, Inc.
    PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedDec 17, '10 at 3:15p
activeDec 17, '10 at 9:53p
posts8
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase