Re: Slow connect due to some queries - Mailing list pgadmin-support

From Guillaume Lelarge
Subject Re: Slow connect due to some queries
Date
Msg-id 4B4F8287.4010605@lelarge.info
Whole thread Raw
In response to Slow connect due to some queries  (Tzvi R <sefer@hotmail.com>)
Responses Re: Slow connect due to some queries  (Tzvi R <sefer@hotmail.com>)
List pgadmin-support
Hi,

Le 13/01/2010 17:16, Tzvi R a écrit :
> [...]
> I've been using pgAdmin for a long time but over time it has become more and more frustrating to use it.
> It's a great application that performs everything I need, however, when first connecting to servers with many
databases,each with many tables, views and other objects (over a VPN) it can often take 20-30 seconds while pgAdmin is
hungbefore it completes running all the prefetch queries.
 
> 

Actually, pgAdmin only looks at your maintenance database or at your
last connected database.

How many databases/objects do you have?

> I've analyzed its logs and it appears that some queries are the main culprit.
> 
> For example (15-20 seconds to run this):
> SELECT oid, format_type(oid, NULL) AS typname FROM pg_type
> 
> We have quite a few entries there (every toasted table, every view and every table have a couple of entries there).
> SELECT count(*) AS typname FROM pg_type
> 35468
> 

That, for sure, is a huge number. A newly created database only have 283
types (on 8.4).

> Also, this same query gets apparently issued twice:
> 2010-01-13 09:44:15 QUERY : Set query (pgdb:5432): SELECT oid, format_type(oid, NULL) AS typname FROM pg_type
> 2010-01-13 09:44:31 QUERY : Set query (pgdb:5432): SELECT oid, format_type(oid, NULL) AS typname FROM pg_type
> 2010-01-13 09:44:52 STATUS : Restoring previous environment... (37.31 secs)
> 
> Causing the application a long time to "connect".
> I was wondering if there's either a way to bring a partial subset of the data (is all of it needed?) or perhaps fetch
itlazily (on demand).
 
> 

Partial subset, no. On demand... don't know.

What I do know is that we have a fix for the 1.12 release that will make
you happy:

Cache datatypes in dlgTable, so they don't have to be
reloaded by dlgColumn, which may be used multiple times
when creating a table [Sachin Srivastava].

We still load all pgtypes, but we use a cache to stop loading all the
data each time a new column is added;


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


pgadmin-support by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re:
Next
From: Guillaume Lelarge
Date:
Subject: Re: can't get pgpass.conf to work with pgagent