pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Cosimo Streppone <cosimo@streppone.it>
To: C Storm <christian.storm@gmail.com>
Cc: Postgresql Performance list <pgsql-performance@postgresql.org>
Subject: Re: Update on high concurrency OLTP application and Postgres
Date: Fri, 22 Sep 2006 22:48:16 +0200
Message-ID: <45144C10.2070501@streppone.it> (raw)
In-Reply-To: <1158943002.460558.40420@b28g2000cwb.googlegroups.com>
References: <45110543.6020501@streppone.it>
	<20060920110731.GB18219@phlogiston.dyndns.org>
	<45113286.2090204@streppone.it>
	<1158943002.460558.40420@b28g2000cwb.googlegroups.com>

Christian Storm wrote:

>>At the moment, my rule of thumb is to check out the ANALYZE VERBOSE
>>messages to see if all table pages are being scanned.
>>
>>   INFO: "mytable": scanned xxx of yyy pages, containing ...
>>
>>If xxx = yyy, then I keep statistics at the current level.
>>When xxx is way less than yyy, I increase the numbers a bit
>>and retry.
>>
>>It's probably primitive, but it seems to work well.
 >
> What heuristic do you use to up the statistics for such a table?

No heuristics, just try and see.
For tables of ~ 10k pages, I set statistics to 100/200.
For ~ 100k pages, I set them to 500 or more.
I don't know the exact relation.

> Once you've changed it, what metric do you use to
 > see if it helps or was effective?

I rerun an analyze and see the results... :-)
If you mean checking the usefulness, I can see it only
under heavy load, if particular db queries run in the order
of a few milliseconds.

If I see normal queries that take longer and longer, or
they even appear in the server's log (> 500 ms), then
I know an analyze is needed, or statistics should be set higher.

-- 
Cosimo





view thread (5+ messages)  latest in thread

Message-ID: <45144C10.2070501@streppone.it>
Permalink:  ../45144C10.2070501@streppone.it/
Also on:    postgresql.org/message-id/45144C10.2070501@streppone.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: cosimo@streppone.it, christian.storm@gmail.com
  Subject: Re: Update on high concurrency OLTP application and Postgres
  In-Reply-To: <45144C10.2070501@streppone.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox