When a data stream is joined to a window, rows are published by the query only when the data stream receives data. When rows arrive in the window, the rows are immediately placed in the window but no output rows are produced. When a row arrives in the data stream, it is conceptually joined to all the rows in the window.
The join produces a Cartesian product. The resulting set of rows is then processed against the conditions of the WHERE clause, and all rows that do not match the selection criteria are filtered out.
Join behavior is identical when a data stream is joined to several windows. Rows arriving in the various windows are added to the respective windows but no output is published. The join query executes only when a row arrives in the stream and produces a Cartesian product of the stream row with all rows in every window.
If the windows are very large and depending upon the selection criteria used to join the data sources, a stream to multiple window join may take considerable execution time to execute for each stream row. Sybase CEP tries to optimize this process by automatically generating indexes for the rows in the windows, and using specialized matching algorithms to minimize the time it takes to correlate the rows.