Public Windows

Create Window statements is used to define a public named window, which enables you to perform a snapshot query of a public window with SQL queries from several locations.

Usage

You can use the Create Window statement to define a public named window. You can:

Indexing

Index a public window in a similar manner to a relational database table. Define an index on a public window on a single column or on multiple columns. Indexing a public window column can significantly improve public window query performance when used with the following SQL operations, either individually or in combination with one another:

Public window indexes do not apply to:

Note that, while having a custom index can significantly improve execution time for public window queries, it may also negatively affect performance of your CCL project as a whole. Pay attention to the performance of your project when adding a public window index.

Warning!  

Sybase CEP Engine supports indexes on BLOB and XML columns, but Sybase does not recommend them since BLOB and XML value comparisons are resource-intensive and will negatively affect performance of your CCL project.

Timestamp Columns in Public Window Queries

All public window queries generate an initial Timestamp column, containing the row timestamp in addition to any columns specified in the query. You can refer to the results of this column in queries of the public window, as in the following example:

INSERT INTO OutStream
SELECT Timestamp
FROM MyPublicWindow; 

See Also

Example

CREATE SCHEMA Myschema (Symbol STRING, Price FLOAT, Volume INTEGER, VWAP FLOAT);
CREATE PUBLIC WINDOW MyPubWindow SCHEMA Myschema 
KEEP 1 HOUR
PROPERTIES INDEXCOLUMNS = "Symbol, Price";