A description of windows in Sybase CEP and their policies.
The window definition states the policy that determines what rows in a stream should be retained and for how long. CCL windows come in several varieties:
Count-based windows have a single count-based policy and retain rows up to a specified maximum number. Alternately, count-based policies may be created to retain a maximum of a specified number of row groups, called buckets. For more information about buckets, please see the KEEP Clause section of the Sybase CEP CCL Reference.
Time-based windows have a single time-based policy and retain rows for a specified interval of time.
Multi-policy windows have one count-based policy and one time-based policy, and retain rows according to both sets of criteria.
Both count-based and time-based windows may be sliding or jumping (and multi-policy windows may be both).
Sliding windows accumulate and expire rows, (or groups of rows called buckets), one at a time. Count-based sliding windows remove rows or buckets from the window as new rows arrive or new buckets are created; time-based sliding windows remove rows from the window as time passes and rows age and expire.
Jumping windows accumulate and expire rows or buckets either up to a specified number (in the case of count-based windows) or for a specified time interval (for time-based windows) then remove all the rows or buckets from the window at once and start accumulating again from an empty window.
Count-based windows may also be grouped. These windows may be thought of as implementing a separate count-based policy for every combination of unique values in one or more key columns. For example, instead of simply retaining the last five rows to arrive in the stream, a grouped window analyzing stock trades might retain the last five rows for each stock symbol.
Both count-based and time-based windows may be ordered. Ordered windows order the rows retained by the window based on the values of one or more columns.
As further described in Windows and Row Propagation, window policies retain row state, but do not affect how quickly rows are propagated to other data streams or windows.