Re: problems with access into system catalogs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux