Re: Checks for command string

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Checks for command string
Дата
Msg-id 200601020055.k020tFG07078@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Checks for command string  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Checks for command string
Список pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Does anyone know why we test for pgstat_collect_querystring in routines
> > that obviously dump only block and row-level statistics and database
> > commit/rollback total?
>
> Because we want commits/rollbacks to be counted if any of them are on.

Why do we want commits/rollbacks counted if we only have command string
enabled?  Here is the test:

    if (pgStatSock < 0 ||
        !(pgstat_collect_querystring ||
          pgstat_collect_tuplelevel ||
          pgstat_collect_blocklevel))

and here are the functions that have it where I think it is wrong:

    pgstat_report_tabstat()
    pgstat_count_xact_commit()
    pgstat_count_xact_rollback()

The stats_command_string documention makes no mention of this:

        Enables the collection of statistics on the currently
        executing command of each session, along with the time at
        which that command began execution. This option is off by
        default. Note that even when enabled, this information is not
        visible to all users, only to superusers and the user owning
        the session being reported on; so it should not represent a
        security risk. This data can be accessed via the
        <structname>pg_stat_activity</structname> system view; refer
        to <xref linkend="monitoring"> for more information.

Seems we should document this somewhere even if the behavior is correct,
which I don't think it is.

The !(x || y) construct is really ugly and I will fix that in a simple
commit now.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-patches по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Checks for command string
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Checks for command string