parse/optimize several SQL(or other QL)s into one logical plan and execute them once.
- use case
If a report generating system is used as a frontend system of drill instead of a command line, There would be a set of similar SQL to execute to generate a report(consider each day's DAU statistics with geoip distribution(groupby) for 7 continuous days). If processed individually, plans for SQLs in this kind of set are similar(scan pv log in these days) or same(scan GeoIP table) in majority. If processed together, duplicated scan(GeoIP) could be eliminated to reduce I/O, or similar scan(pv) could be merged to achieve better throughput, and provides chances of other intermediate result reuse.
Query in a QL is represented as a tree. Drill models logical plan and physical plan as DAG, which is more expressive than tree. More precisely, a set of trees(with common nodes or common edges) can be union-ed into a dag. So, the current drill logical/physical plan model supports multiple query already. Each sql would have a corresponding StoreOP as its result.
To do so, physical operators must support multiple iteration over its output. That would have side effect on mem management.