Optimisation studies in a Prolog object-oriented database
This thesis is about query optimisation studies in a Prolog object-oriented database (P/FDM). Although many of the query optimisation techniques used in relational database systems can be adapted to solve problems in query optimisation for object-oriented databases (OODBs), there are also many problems that are unique to the OODBs, and new techniques need to be developed. Techniques developed for optimising queries in OODB systems can be categorised into three distinct approaches, namely, algebraic transformation, type-based transformation, and method optimisation. However, few OODB systems have used the combination of all three techniques in the design of their query optimisers. We have adopted an unified approach by combining them into the optimisation strategy of a query optimiser for P/FDM. The overall architecture of the P/FDM query optimiser is based on the top-down framework. The source language of the query optimiser is an extension of Shipman's original DAPLEX language. We choose ZF notation, based on set comprehensions in Zermelo-Frankel (ZF) set theory, to represent the intermediate forms of DAPLEX queries. The target language of optimiser is a set of P/FDM primitives which are implemented in Prolog. We have taken the approach of asking the database to reveal the definitions of methods to the optimiser as privileged code. Most OODB systems do not perform method optimisation because of the difficulties caused by defining methods in a procedural programming language. We have been greatly helped by using a functional programming approach which holds methods in a declarative form, and thus makes it much easier to combine and transform them. Heuristics are incorporated into the query optimisation strategy to avoid exhaustive search, so that the optimiser is able to produce efficient query evaluation plans within satisfactory response times.