Max simultaneous users

Поиск
Список
Период
Сортировка
От webb sprague
Тема Max simultaneous users
Дата
Msg-id 01051110103601.08603@lappi.o1.com
обсуждение исходный текст
Ответ на Re: SQL Server -> Postgres migration: Stored Procedure replacement?  (Roger Wernersson <rw@mindark.com>)
Ответы WAL logs eating my diskspace!!  (webb sprague <wsprague@o1.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Help: Change the SQL query length
Следующее
От: teg@redhat.com (Trond Eivind Glomsrød)
Дата:
Сообщение: Re: Too Many Open Files PG 7.1