| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> |
| Cc: | "Michael Fuhr" <mike(at)fuhr(dot)org>, pgsql-performance(at)postgresql(dot)org, "Carlos Benkendorf" <carlosbenkendorf(at)yahoo(dot)com(dot)br> |
| Subject: | Re: How much expensive are row level statistics? |
| Date: | 2005-12-12 23:01:01 |
| Message-ID: | 2506.1134428461@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-patches pgsql-performance |
"Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com> writes:
>> The cost depends on your usage patterns. I did tests with one of
>> my applications and saw no significant performance difference for
>> simple selects, but a series of insert/update/delete operations ran
>> about 30% slower when block- and row-level statistics were enabled
>> versus when the statistics collector was disabled.
> That approximately confirms my results, except that the penalty may even
> be a little bit higher in the worst-case scenario. Row level stats hit
> the hardest if you are doing 1 row at a time operations over a
> persistent connection.
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.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joshua D. Drake | 2005-12-12 23:07:35 | Re: buildfarm off the air pro tem |
| Previous Message | Andrew Dunstan | 2005-12-12 23:00:01 | Re: buildfarm off the air pro tem |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joachim Wieland | 2005-12-12 23:39:31 | Re: TODO item: list prepared queries |
| Previous Message | Jim C. Nasby | 2005-12-12 21:36:41 | Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 digits |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Marlowe | 2005-12-12 23:12:01 | Re: opinion on disk speed |
| Previous Message | Manfred Koizar | 2005-12-12 22:34:12 | Re: Joining 2 tables with 300 million rows |