1. A system for optimizing pattern queries, comprising: a non-transitory memory device for storing computer readable program code; and a processor device in communication with the memory device, the processor device being operative with the computer readable program code to perform steps including generating jumbo query plans by applying a common sharing technique and an operator transformation technique and combining at least two of the pattern queries, searching, within the jumbo query plans, for an optimal query plan, and executing the optimal query plan on an input data stream to generate an output data stream.