I have an event table that has the following fields:
event_id
event_type
event_time
Given a duration D
and a number k
, I need a count of all the event_type
's that had more than K
events in any relative time window of duration D
. This basically requires a sliding window with respect to each event. For example, I want all the event_type's that had activity of more than 5 events in any 10 minute duration.
I am not sure how to work around this without window functions.
(I am on mysql 5.6. I am talking about a dataset of under 1 million rows.)
See Question&Answers more detail:os