Max simultaneous users

From: webb sprague <wsprague(at)o1(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Cc: skaten(at)o1(dot)com
Subject: Max simultaneous users
Date: 2001-05-11 14:10:36
Message-ID: 01051110103601.08603@lappi.o1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ryan 2001-05-11 14:10:39 VACUUM notices
Previous Message Tom Lane 2001-05-11 13:30:11 Re: Re: Query not using index

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Eckermann 2001-05-11 14:35:39 RE: Order by email address by domain ?
Previous Message Alexey Nalbat 2001-05-11 11:47:55 can't get rid of unnesesary SORT step in explain plan for hash join