Abstract-In a data stream management system, a continuous query is processed by an execution plan consisting of multiple operators connected via the "consumer-producer" relationship, i.e., the output of an operator (the "producer") feeds to another downstream operator (the "consumer") as input. Existing techniques execute each operator separately and push all results to its consumers, without considering whether the consumers need them. Consequently, considerable CPU and memory resources are wasted on producing and storing useless intermediate results. Motivated by this, we propose just-in-time (JIT) processing, a novel methodology that enables a consumer to return feedback expressing its current demand to the producer. The latter selectively generates results based on this information. We show, through extensive experiments, that JIT achieves significant savings in terms of both CPU time and memory consumption.
I. INTRODUCTIONIn typical data stream applications, including wireless sensor networks [5], road traffic monitoring [3] and publishsubscribe services [10], data continuously flow into a DSMS. Users of the DSMS pose long-running queries, whose results are incrementally evaluated as data records arrive or expire. To answer such a query, the DSMS runs an execution plan consisting of multiple basic operators (e.g., selections, joins) connected via the producer-consumer relationship, where the output of the producer comprises the input of the consumer. Besides a few top-level operators whose results are directly presented to the user, most operators generate output for the sole purpose of feeding their consumers. Figure 1a shows an example of a continuous query expressed in CQL [1]. Tuples from three streaming sources A, B and C are joined to detect a certain event. As a real-world example, an abnormal combination of readings from close-by humidity, light and temperature sensors may trigger the alarm in a factory [5]. The clause "RANGE 5 minutes" specifies that each record is alive for exactly 5 minutes, after which it expires and is purged from the system. Figure 1b illustrates