pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: webb sprague <wsprague@o1.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Cc: skaten@o1.com
Subject: Max simultaneous users
Date: Fri, 11 May 2001 10:10:36 -0400
Message-ID: <01051110103601.08603@lappi.o1.com> (raw)
In-Reply-To: <3AF83B71.1C8DDDFA@mindark.com>
References: <000601c0d202$203b2b10$2001a8c0@blockhead>
	<3AF83B71.1C8DDDFA@mindark.com>

We have a table with a lot of user sessions (basically end -time and 
length of connection).  We would like to query this table to count the max 
number of simultaneous sessions, but we are stumped on how to do that.

The only thing I have been able to think of is to iterate over the entire 
table and count the number of connections at the beginning and end of each 
user session, keeping a variable that records the time and max number of 
sessions at each iteration.  We can do this in either in Perl or PL/SQL, but 
it seems like it would be *horribly* slow, especially considering we have 
about 250,000 of these records come in a day.

I also wonder if there might be some intermediate data structure that we 
could create to make this easy, but I thought I would rely on other people's 
experience before trying to do this myself...:)

Thanks 



Message-ID: <01051110103601.08603@lappi.o1.com>
Permalink:  ../01051110103601.08603@lappi.o1.com/
Also on:    postgresql.org/message-id/01051110103601.08603@lappi.o1.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: wsprague@o1.com, pgsql-general@postgresql.org, skaten@o1.com
  Subject: Re: Max simultaneous users
  In-Reply-To: <01051110103601.08603@lappi.o1.com>
  References: <000601c0d202$203b2b10$2001a8c0@blockhead> <3AF83B71.1C8DDDFA@mindark.com> <01051110103601.08603@lappi.o1.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox