pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Thomas Markus <t.markus@proventis.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: problems with access into system catalogs
Date: Thu, 26 Jul 2012 16:25:22 +0800
Message-ID: <5010FEF2.3050901@ringerc.id.au> (raw)
In-Reply-To: <5010F555.9020209@proventis.net>
References: <5010F555.9020209@proventis.net>

First, thank-you for an excellent complete question with versions, 
EXPLAIN ANALYZE, and exact messages.

My reply is interleaved below.

On 07/26/2012 03:44 PM, Thomas Markus wrote:
> I have 2 systems with CentOS 5.5 (2.6.18) x86_64, postgresql-9.0.6 64bit
>
> both systems contains the same content. But one system make troubles. 
> some system tables (eg pg_catalog.pg_class or pg_attribute) contain 
> much dead rows and all simple query take much time on one system. the 
> other one is fast.

[snip]

> other:
> INFO:  "pg_class": found 0 removable, 1547667 nonremovable row 
> versions in 31587 out of 31587 pages
> DETAIL:  1545530 dead row versions cannot be removed yet.
>
> a "select count(*) from pg_catalog.pg_class" returns only 2137
>

OK, so you have lots of bloat in the system catalogs. A few things to 
check for:

- Do you have any uncommitted two phase transactions?  Run:
   SELECT * from pg_prepared_xacts ;

- Do you have any long-lived 'IDLE IN TRANSACTION' connections ? Try:
   SELECT * FROM pg_stat_activity WHERE current_query = '<IDLE> in 
transaction' AND xact_start > current_timestamp - '1 minute'::interval;

Either of those can prevent vacuum from cleaning things up.

Do you very frequently create and drop tables, indexes, etc? Say, using 
a database unit testing framework?

--
Craig Ringer



view thread (6+ messages)  latest in thread

Message-ID: <5010FEF2.3050901@ringerc.id.au>
Permalink:  ../5010FEF2.3050901@ringerc.id.au/
Also on:    postgresql.org/message-id/5010FEF2.3050901@ringerc.id.au

 · 

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-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, t.markus@proventis.net
  Subject: Re: problems with access into system catalogs
  In-Reply-To: <5010FEF2.3050901@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