Re: How much expensive are row level statistics? - Mailing list pgsql-performance

From Tom Lane
Subject Re: How much expensive are row level statistics?
Date
Msg-id 1667.1134444045@sss.pgh.pa.us
Whole thread Raw
In response to Re: How much expensive are row level statistics?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: How much expensive are row level statistics?  (Michael Fuhr <mike@fuhr.org>)
Re: How much expensive are row level statistics?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-performance
Michael Fuhr <mike@fuhr.org> writes:
> Further tests show that for this application
> the killer is stats_command_string, not stats_block_level or
> stats_row_level.

I tried it with pgbench -c 10, and got these results:
    41% reduction in TPS rate for stats_command_string
    9% reduction in TPS rate for stats_block/row_level (any combination)

strace'ing a backend confirms my belief that stats_block/row_level send
just one stats message per transaction (at least for the relatively
small number of tables touched per transaction by pgbench).  However
stats_command_string sends 14(!) --- there are seven commands per
pgbench transaction and each results in sending a <command> message and
later an <IDLE> message.

Given the rather lackadaisical way in which the stats collector makes
the data available, it seems like the backends are being much too
enthusiastic about posting their stats_command_string status
immediately.  Might be worth thinking about how to cut back the
overhead by suppressing some of these messages.

            regards, tom lane

pgsql-performance by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: How much expensive are row level statistics?
Next
From: Marc Cousin
Date:
Subject: partitioning