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

From Michael Fuhr
Subject Re: How much expensive are row level statistics?
Date
Msg-id 20051213010751.GA63416@winnie.fuhr.org
Whole thread Raw
In response to Re: How much expensive are row level statistics?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How much expensive are row level statistics?
List pgsql-performance
On Mon, Dec 12, 2005 at 06:01:01PM -0500, Tom Lane wrote:
> IIRC, the only significant cost from enabling stats is the cost of
> transmitting the counts to the stats collector, which is a cost
> basically paid once at each transaction commit.  So short transactions
> will definitely have more overhead than longer ones.  Even for a really
> simple transaction, though, 30% seems high --- the stats code is
> designed deliberately to minimize the penalty.

Now there goes Tom with his skeptical eye again, and here comes me
saying "oops" again.  Further tests show that for this application
the killer is stats_command_string, not stats_block_level or
stats_row_level.  Here are timings for the same set of operations
(thousands of insert, update, and delete statements in one transaction)
run under various settings:

stats_command_string = off
stats_block_level = off
stats_row_level = off
time: 2:09.46

stats_command_string = off
stats_block_level = on
stats_row_level = off
time: 2:12.28

stats_command_string = off
stats_block_level = on
stats_row_level = on
time: 2:14.38

stats_command_string = on
stats_block_level = off
stats_row_level = off
time: 2:50.58

stats_command_string = on
stats_block_level = on
stats_row_level = on
time: 2:53.76

[Wanders off, swearing that he ran these tests before and saw higher
penalties for block- and row-level statistics.]

--
Michael Fuhr

pgsql-performance by date:

Previous
From: "J. Andrew Rogers"
Date:
Subject: Re: opinion on disk speed
Next
From: Tom Lane
Date:
Subject: Re: How much expensive are row level statistics?