Patent ID: 8296316

Claim:
A computer-implemented method of processing a plurality of input streams of data, the method comprising: processing the plurality of input streams in a computer, by executing thereon a plurality of existing continuous queries based on a global plan; during said processing, receiving a new continuous query to be executed; during said processing, preparing an additional plan for use in execution of the new continuous query independent of the global plan; wherein the additional plan is created and optimized independent of the global plan currently used by said processing, the additional plan including physical operators to execute the new continuous query; during said processing, traversing the additional plan in a bottom up manner, to select therefrom a current node; during said processing, checking if an operator at the current node is equivalent to any operator in a plurality of operators in the global plan currently used by said processing; wherein two operators that perform identical functions with identical inputs are determined by said checking to be equivalent; if said checking finds no equivalent, modifying the global plan currently used by said processing by adding thereto said operator at the current node to obtain a modified plan during said processing; if said checking finds equivalence, and if said operator at the current node outputs a relation, propagating from said any operator, a current state of said relation to a new operator in the modified plan for use in executing said new continuous query prior to execution of the new continuous query; wherein said propagating comprises using as said current state, a plurality of past tuples of said relation having a time stamp older than a current time; returning to said traversing with the modified plan as the global plan, unless the current node is a root of the additional plan; altering said processing, to cause execution of the new continuous query in addition to said plurality of existing continuous queries, based on the modified plan; wherein said execution of the new continuous query on a stream in the plurality of input streams does not use any past tuples and instead uses new tuples that are time stamped after the current time; and outputting from said computer, a stream generated based at least partially on processing of said data by executing the new continuous query.