Multi-query Optimisation¶
Multi-Query Optimisation¶
Alternatives for evaluating operation trees are
Materialisation¶
Store the result of one query element directly on the disk. The optimiser generates a plan such that common elements of queries \(\{Q_i\}\) are executed only once, stored on the disk, then reused. * This is also referred to as flyweighting or caching.
Pipelining¶
As the result of one tuple comes, pass it to the next operation. Consider WHERE-JOIN-GROUPBY-HAVING as a pipeline similar to the RISC pipeline. This can be parallelised for speed-up. * not possible in something like a sort or a hash join. * cheaper than materialisation, as there is no need to store to disk.
Demand Driven¶
- a.k.a. lazy evaluation, pull model.
- The operation latter in the pipeline pulls records from the operation behind in the pipeline.
Producer Driven¶
- a.k.a. eager ealuation, push model.
- The operation behind in the pipeline immediately pushes ahead in the pipeline