Skip site navigation (1) Skip section navigation (2)

Re: \d on database with a lot of tables is slow

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: \d on database with a lot of tables is slow
Date: 2005-09-27 22:46:26
Message-ID: 20050927224626.GC30974@pervasive.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Sep 26, 2005 at 03:00:44PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> >>> I have a client with a database that contains 4000 relations according
> >>> to vacuum verbose, and \d in psql is painfully slow. In particular...
> 
> It's presumably mostly in the pg_table_is_visible() calls.  Not sure if
> we can do much to speed those up, but: how many schemas in your search
> path?  What's the distribution of pg_class entries among the schemas?

db=# show search_path;
 decibel, pg_sysviews, information_schema, rrs, public

db=# select schema_name, count(*) from pg_user_tables group by schema_name;
 public         |   764
 ledger         |     6
 state          |     2
 _track_replica |    10
 repair         |     3
 summarized     |   586
 orders         |   512
 snapshot       |  1012
 acl            |    10

db=# 

Also, do you have any idea on the 'Did not find relation named
"table-thats-there"' error? table-thats-there isn't a temp table, and I don't
believe they're even using temp tables, so I don't think that's the issue.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby(at)pervasive(dot)com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-09-27 22:46:55
Subject: Proposed patch for sequence-renaming problems
Previous:From: Jim C. NasbyDate: 2005-09-27 22:36:11
Subject: Re: Re-run query on automatic reconnect

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group