Enhanced segment trees in object-relational mapping

  • Authors:
  • Michał Gawarkiewicz;Piotr Wiśniewski;Krzysztof Stencel

  • Affiliations:
  • Nicolaus Copernicus University, Toruń, Poland;Nicolaus Copernicus University, Toruń, Poland;University of Warsaw Warsaw, Poland

  • Venue:
  • Proceedings of the 6th Balkan Conference in Informatics
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Tree-shaped data often occur in business applications, e.g. a corporate hierarchy or a categorization of products. A natural class of analytic queries posed to such data consists of aggregate queries over subtrees. Evaluation of such queries in large data sets requires significant amount of time. In this paper we focus on dedicated data structures that materialize partial results of such queries in a form of well-known segment trees. In a multiprogramming environment such data structures require careful implementation. A naïve design is going to suffer from synchronization problems. The root of such a structure will be updated by each transaction that changes anything down its subtree. We propose ring updates that allow using the presented data structure with multiple execution threads. Our implementation is designed to work with object-relational mapping systems. If an application uses stored hierarchical data, its designer can add annotations to augment mapped database objects with materialization of partial aggregations over subtrees. Mapping generators create all necessary storage objects and triggers. We describe our proof-of-concept prototype implementation of this feature in Hibernate. We also present an experimental evaluation of this prototype's performance. The results confirm that the proposed materializations notably boost the evaluation of analytical queries over hierarchies.