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, wherein each jumbo query plan is generated by combining at least two of the pattern queries, the common sharing technique comprising: decomposing first and second pattern queries into respective first and second sets of sub-queries based on finite-state machines of the first and second pattern queries, and identifying, from the first and second sets of sub-queries, a common sub-query sharing results between the first and second pattern queries; and the operator transformation technique enabling sharing output of a transformed pattern query with other pattern queries associated with different types of operators; searching, within the jumbo query plans, for an optimal jumbo query plan, and executing the optimal jumbo query plan on an input data stream to generate an output data stream.