pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Y Sidhu <ysidhu@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Parsing VACUUM VERBOSE
Date: Thu, 14 Jun 2007 14:34:13 -0700
Message-ID: <b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com> (raw)
In-Reply-To: <1d4e0c10706141401u2ae5ff73x61a86973b13f6133@mail.gmail.com>
References: <f4rjfa$1187$1@news.hub.org>
	<200706141653.33808.dfontaine@hi-media.com>
	<b09064f30706140830g6d2e19d4v3059eb2be23292fb@mail.gmail.com>
	<1d4e0c10706141401u2ae5ff73x61a86973b13f6133@mail.gmail.com>

On 6/14/07, Guillaume Smet <guillaume.smet@gmail.com> wrote:
>
> On 6/14/07, Y Sidhu <ysidhu@gmail.com> wrote:
> > Can anyone share what value they have set log_min_duration_statement to?
>
> It's OT but we use different values for different databases and needs.
>
> On a very loaded database with a lot of complex queries (lots of join
> on big tables, proximity queries, full text queries), we use 100 ms.
> It logs ~ 300 000 queries. It allows us to detect big regressions or
> new queries which are very slow.
>
> On another database where I want to track transaction leaks, I'm
> forced to put it to 0ms.
>
> Basically, the answer is: set it to the lowest value you can afford
> without impacting too much your performances (and if you use syslog,
> use async I/O or send your log to the network).
>
> --
> Guillaume
>

I am trying to answer the question of how to tell if the cleanup of an index
may be locked by a long transaction. And in the bigger context, why vacuums
are taking long? What triggers them? I came across the following query which
shows one table 'connect_tbl'  with high "heap hits" and "low heap buffer %"
Now, 'heap' seems to be a memory construct. Any light shedding is
appreciated.

mydb=# SELECT
mydb-# 'HEAP:'||relname AS table_name,
mydb-# (heap_blks_read+heap_blks_hit) AS heap_hits,
        ROUND(((heap_blks_hit)::NUMERIC/(heap_blks_read+heap_blks_hit)*100),
2)
mydb-# ROUND(((heap_blks_hit)::NUMERIC/(heap_blks_read+heap_blks_hit)*100),
2)
mydb-# AS heap_buffer_percentage
mydb-# FROM pg_statio_user_tables
mydb-# WHERE(heap_blks_read+heap_blks_hit)>0
mydb-# UNION
mydb-# SELECT
mydb-# 'TOAST:'||relname,
mydb-# (toast_blks_read+toast_blks_hit),
mydb-#
ROUND(((toast_blks_hit)::NUMERIC/(toast_blks_read+toast_blks_hit)*100), 2)
mydb-# FROM pg_statio_user_tables
mydb-# WHERE(toast_blks_read+toast_blks_hit)>0
mydb-# UNION
mydb-# SELECT
mydb-# 'INDEX:'||relname,
mydb-# (idx_blks_read+idx_blks_hit),
mydb-# ROUND(((idx_blks_hit)::NUMERIC/(idx_blks_read+idx_blks_hit)*100), 2)
mydb-# FROM pg_statio_user_tables
mydb-# WHERE(idx_blks_read+idx_blks_hit)>0;
        table_name            | heap_hits | heap_buffer_percentage
------------------------------------+--------------+----------------------------------
 HEAP:connect_tbl         |    890878 |                  43.18
 HEAP:tblbound_tbl         |     43123 |                  13.80
 HEAP:tblcruel_tbl          |    225819 |                   6.98
 INDEX:connect_tbl         |    287224 |                  79.82
 INDEX:tblbound_tbl         |     81640 |                  90.28
 INDEX:tblcruel_tbl          |    253014 |                  50.73

-- 
Yudhvir Singh Sidhu
408 375 3134 cell

view thread (11+ messages)  latest in thread

Message-ID: <b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com>
Permalink:  ../b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com/
Also on:    postgresql.org/message-id/b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: ysidhu@gmail.com
  Subject: Re: Parsing VACUUM VERBOSE
  In-Reply-To: <b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com>
  References: <f4rjfa$1187$1@news.hub.org> <200706141653.33808.dfontaine@hi-media.com> <b09064f30706140830g6d2e19d4v3059eb2be23292fb@mail.gmail.com> <1d4e0c10706141401u2ae5ff73x61a86973b13f6133@mail.gmail.com> <b09064f30706141434t530844a3x5ad09a1f7ef2aac7@mail.gmail.com>

* 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