Abstract. Hierarchical and graph data structures are common in practical application development. In order to query such data, one can use SQL:1999 recursive queries based on Common Table Expressions. Nowadays, numerous relational database management systems implement them. However, some popular systems, e.g. MySQL, still lack this useful feature. In this paper we show three methods to circumvent this situation: (1) the direct loop, (2) horizontal unrolling and (3) vertical unrolling. We analyze them and present a report on tests of their efficiency. We also describe our implementation of these methods as a prototype extension to Hibernate, a major object-relational mapping system. This extension allows running SQL:1999 recursive queries directly from an application code, even when the underlying DBMS does not support them.
Abstract. Recursive data structures are often used in business applications. They store data on e.g. corporate hierarchies, product categories and bill-of-material. Therefore, recursive queries as introduced by SQL:1999 or formerly implemented by Oracle constitute a useful facility for application programmers. Unfortunately, recursive queries are not implemented by a number of database systems with MySQL as the most profound example. If an application has such a database as the backend storage, recursive queries will be usually hard-coded at the client side. This is not efficient. In this paper we propose using redundant data structures to answer recursive queries quicker. Such structures must be synchronized in response to updates of data. This means a significant processing overhead for updates. We present experimental evaluation to show loses and gains caused by our solution for various usage scenarios. They prove the feasibility of our proposal. We show our proof-of-concept implementation as a part of the Hibernate framework. Thus, application programmers are separated from all internals of necessary database objects and triggers. These are created automatically by Hibernate generators.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.