From: Craig Ringer <ringerc@ringerc.id.au>
To: Yan Chunlu <springrider@gmail.com>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: how could select id=xx so slow?
Date: Tue, 10 Jul 2012 09:25:33 +0800
Message-ID: <4FFB848D.7080900@ringerc.id.au> (raw)
In-Reply-To: <CAOA66tF8dAzAS9wG381bhp+AiC2LrzcF7MDmOxvgW0p07rMNtw@mail.gmail.com>
References: <CAOA66tEJLDOt4JpJ0RwOEsgizfQPWkCHd+SgT7kbiHix_io18A@mail.gmail.com>
<D960CB61B694CF459DCFB4B0128514C2081BF021@exadv11.host.magwien.gv.at>
<CAOA66tF8dAzAS9wG381bhp+AiC2LrzcF7MDmOxvgW0p07rMNtw@mail.gmail.com>
On 07/09/2012 05:20 PM, Yan Chunlu wrote:
>
> the value of "log_min_messages" in postgresql.conf is error, I have
> changed it to "warning", so far does not received any warning, still
> waiting.
When trying to track down performance issues, increasing logging to at
least `info' would seem to be sensible.
I suggest increasing your logging and enabling the auto_explain module
so it logs slow queries. If you can afford the substantial performance
hit you could enable its analyze mode to get details on why.
>
> beside I do see some COMMIT which is relatively slow for example:
> 60 2012-07-08 00:00:29 CST [19367]: [131-1] LOG: duration: 375.851
> ms statement: COMMIT
> 61 2012-07-08 00:00:30 CST [19367]: [132-1] LOG: duration: 327.964
> ms statement: COMMIT
That certainly is slow. Again, I suspect checkpoint activity could be at
fault. You may need to tune to spread your checkpoints out and use more
aggressive bgwriter settings. See the wiki for performance tuning info.
>
> but only one "BEGIN" in the same one day log file, did that influence
> the query time too?
Only one BEGIN in the whole day? Or do you mean "only one BEGIN slow
enough to trigger slow query logging" ?
Do you have a "log_min_duration_statement" directive set in your
postgresql.conf ?
--
Craig Ringer
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: ringerc@ringerc.id.au, springrider@gmail.com, laurenz.albe@wien.gv.at
Subject: Re: how could select id=xx so slow?
In-Reply-To: <4FFB848D.7080900@ringerc.id.au>
* 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