Avoiding Materialisation for Guarded Aggregate Queries
<|reference_start|>Avoiding Materialisation for Guarded Aggregate Queries: Database systems are often confronted with queries that join many tables but ultimately only output comparatively small aggregate information. Despite all advances in query optimisation, the explosion of intermediate results as opposed to a much smaller final result challenges modern relational database management systems (DBMSs). In this work, we propose the integration of optimisation techniques into relational DBMSs that aim at minimising, and often entirely eliminating, the need for materialising join results for aggregate queries, provided that they satisfy certain conditions. Apart from novel logical optimisations aimed at practicability, we also provide new, natural, physical operators for combining joins and counting with the aim of reducing the size of intermediate results. We experimentally validate the efficacy of our optimisations through their implementation in Spark SQL, but we note that they are naturally applicable in any RDBMS. Our experiments show consistent significant speed-ups -- often by factor 2 and higher -- for analytical and graph queries. At the same time, we observe no performance degradation, even on queries which, from a theoretical point of view, are least amenable to the proposed optimisations.<|reference_end|>
@article{lanzinger2024avoiding,
    title={Avoiding Materialisation for Guarded Aggregate Queries},
    author={Matthias Lanzinger, Reinhard Pichler, Alexander Selzer},
    journal={arXiv preprint arXiv:2406.17076},
    year={2024},
    archivePrefix={arXiv},
    eprint={2406.17076},
    primaryClass={cs.DB}
}