Re: how to find the sql using most of the i/o in an oltp system

From: "Gavin M(dot) Roy" <gmr(at)myyearbook(dot)com>
To: Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com>
Cc: Alexander Staubo <alex(at)bengler(dot)no>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: how to find the sql using most of the i/o in an oltp system
Date: 2008-06-15 14:53:06
Message-ID: 2AE1C749-45BA-4926-8065-38FD6EC0E861@myyearbook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Check out pgFouine.

Sent from my iPhone

On Jun 15, 2008, at 10:41 AM, "Uwe Bartels" <uwe(dot)bartels(at)gmail(dot)com>
wrote:

> Hi Alexander,
>
> thanks for you answer.
> What you wrote in terms of postgres I knew. I just tested to log all
> statements with statistics. This is a lot of unstructured data in a
> logfile. But this is the best I found as far.
>
> The database is running on a solaris box. So DTrace is no problem. I
> couldn't find any dtrace scripts for postgres. Do you know any
> scripts except this sample script?
>
> Thanks.
> Uwe
>
> On Sun, Jun 15, 2008 at 4:03 PM, Alexander Staubo <alex(at)bengler(dot)no>
> wrote:
> On Sun, Jun 15, 2008 at 3:48 PM, Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com>
> wrote:
> > Tuning a sql statements I'm familiar with. Finding a sql statement
> which
> > takes too long due to i/o is probably easy as well. But how about
> statements
> > that take about 100 ms, that read a lot and that are executed
> several times
> > per second?
>
> Take a look at the PostgreSQL manual chapter on monitoring and
> statistics:
>
> http://www.postgresql.org/docs/8.3/interactive/monitoring.html
>
> If you have access to DTrace (available on Solaris, OS X and possibly
> FreeBSD), you could hook the low-level system calls to reads and
> writes. If you don't have access to DTrace, the pg_statio_* set of
> tables is your main option. In particular, pg_statio_user_tables and
> pg_statio_user_indexes. See the documentation for the meaning of the
> individual columns.
>
> Unfortunately, the statistics tables are not transaction-specific
> (indeed I believe they only update once you commit the transaction,
> and then only after a delay), meaning they capture statistics about
> everything currently going on in the database. The only way to capture
> statistics about a single query, then, is to run it in complete
> isolation.
>
> Alexander.
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message luke.78@libero.it 2008-06-16 09:06:44 function difference(geometry,geometry) is SLOW!
Previous Message Uwe Bartels 2008-06-15 14:41:25 Re: how to find the sql using most of the i/o in an oltp system