[GENERAL] time series data

Поиск
Список
Период
Сортировка
От Khalil Khamlichi
Тема [GENERAL] time series data
Дата
Msg-id CAEK98WZNR-xS7d6sG+o2o8Yde1g0iarRekNfj8g6gDQRL+vq3w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] time series data  (Melvin Davidson <melvin6925@gmail.com>)
Re: [GENERAL] time series data  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: [GENERAL] time series data  (Nico Williams <nico@cryptonector.com>)
Re: [GENERAL] time series data  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
Hi everyone,

I have a data stream of a call center application coming in  to postgres in this format :

user_name, user_status, event_time

'user1', 'ready', '2017-01-01 10:00:00'
'user1', 'talking', '2017-01-01 10:02:00'
'user1', 'after_call', '2017-01-01 10:07:00'
'user1', 'ready', '2017-01-01 10:08:00'
'user1', 'talking', '2017-01-01 10:10:00'
'user1', 'after_call', '2017-01-01 10:15:00'
'user1', 'paused', '2017-01-01 10:20:00'
...
...

so as you see each new insert of an "event" is in fact the start_time of that event and also the end_time of the previous one so should be used to calculate the duration of this previous one.

What is the best way to get user_status statistics like total duration, frequency, avg ...etc , does any body have an experience with this sort of data streams ?


Thanks in advance.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Plan changes from index scan to seq scan after 5 executions
Следующее
От: rakeshkumar464
Дата:
Сообщение: [GENERAL] Revolut - postgres ?