From: | "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com> |
---|---|
To: | pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Re: Number of connections |
Date: | 2007-12-10 15:25:25 |
Message-ID: | 1A6E6D554222284AB25ABE3229A927621129A5@nrtexcus702.int.asurion.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
> -----Original Message-----
> From: Heikki Linnakangas [mailto:hlinnaka(at)gmail(dot)com] On Behalf Of Heikki
> Linnakangas
> Sent: Monday, December 10, 2007 9:12 AM
> To: Roberts, Jon
> Cc: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] Number of connections
>
> Roberts, Jon wrote:
> > I've noticed that when using pgAdmin, each user will have multiple
> > connections to the database. We actually observe three connections for
> each
> > user which seem to be:
> > 1. pgAdmin UI
> > 2. Maintenance database
> > 3. Query Window
> >
> > Then for each Query Window, there is another connection created. So if
> a
> > user wants to execute two concurrent queries, they actually have four
> > database connections open.
> >
> > Wouldn't it be better to create a connection pool and only increment
> beyond
> > one connection to the database when there are true concurrent requests?
> I
> > believe this is how M$ SQL Server handles this.
> >
> > Alternatively, limiting the client to only one connection would be OK
> too
> > and be less work than implementing a connection pool. Maybe this could
> be a
> > configuration setting. (Multi-thread yes/no).
>
> Would be problematic at least for the Query Windows, because the SQL
> script might set session-variables, create temp tables etc.
>
It took me a minute, but I think I see what you mean now. It would have to
be a modified connection pool like M$. When you execute a query, it creates
a new connection to the database only if the existing connection isn't busy.
When this happens, the connection is stuck to this query window. Sort of
like a sticky session in a web browser.
I would think far less code would be needed if the tool could be configured
to only use one connection.
Jon
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2007-12-10 15:41:48 | Re: Number of connections |
Previous Message | Heikki Linnakangas | 2007-12-10 15:11:49 | Re: Number of connections |