Re: Enumeration of tables is very slow in largish database - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: Enumeration of tables is very slow in largish database
Date
Msg-id 1326289301.2300.10.camel@localhost.localdomain
Whole thread Raw
In response to Enumeration of tables is very slow in largish database  (Kirill Müller <kirill.mueller@ivt.baug.ethz.ch>)
List pgsql-general
On Wed, 2012-01-11 at 11:07 +0100, Kirill Müller wrote:
> Hi all,
>
> we have a Postgres/PostGIS database with 100+ schemas and 200+ tables in
> each schema, generated automatically. When adding a new PostGIS layer in
> QGis, the application obviously enumerates all tables, and this takes
> minutes. Even browsing the database in pgAdmin3 is horribly slow -- it
> takes several seconds to e.g. open a schema (click on a schema's "+" in
> the tree view).
>
> The problems occurred only after adding that many schemas to the
> database. Before, with only 10+ schemas, the performance was acceptable.
>
> Is this a known limitation of Postgres, or perhaps a misconfiguration of
> our installation?

I don't think it has anything to do with PostgreSQL. It has to do with
the client. I don't know for QGis but, in the case of pgAdmin, I'm
pretty sure the issue is pgAdmin. When you click on the + sign of a
schema, pgAdmin has to get all the informations on the schema: tables,
columns, constraints, triggers, and all the other objets found in the
schema. It could take some time. Moreover, pgAdmin has to put all this
in the treeview, and my guess would be that it's probably the most time
consuming operation here. We could probably get better performance, but
I didn't have the time to look at that yet.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org


pgsql-general by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Can a function return more then one table?
Next
From: Andres Freund
Date:
Subject: Re: Enumeration of tables is very slow in largish database