Allan Kamau wrote:
Hi Steve,
Am having difficulties (there is a chance I could be the only one) trying to see how the results you've listed under "I would want to get:" section can be generated from the information you have provided in your implicit problem statement.
Remember the events are listed chronologically. Stated verbosely:

1: Value 1 happened 1 sequential time
3: Value 3 happened 1 sequential time
1: Value 1 happened 1 sequential time
4:
4: Value 4 happened 2 sequential times
5: Value 5 happened 1 sequential time
4 : Value 4 happened 1 sequential time
2:
2:
2 : Value 2 happened 3 sequential times
4:
4 : Value 4 happened 2 sequential times
7 : Value 7 happened 1 sequential time
4 : Value 4 happened 1 sequential time

So the summary is:
Event type 1 appeared in a cluster of 1 event  2 times
Event type 2 appeared in a cluster of 3 events 1 time
Event type 3 appeared in a cluster of 1 event  1 time
Event type 4 appeared in a cluster of 1 event  1 time
Event type 4 appeared in a cluster of 2 events 3 times
Event type 5 appeared in a cluster of 1 event  1 time
Event type 7 appeared in a cluster of 1 event  1 time

Given the summary table, I can then look at distributions of run-lengths for different event-types. If I know the distributions for a system operating normally, I can establish criteria to use for generating alerts and alarms.

I have generated the above using external programs but if I can do so with a query, I would prefer to do so.

Cheers,
Steve


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to