User Defined Indexing
Logic programming provides an ideal framework for tackling complex data, such as the multi-dimensional vector-based data used to represent spatial databases. Unfortunately, the usefulness of logic programming systems if often hampered by the fact that most of these systems have to rely on a single unification-based mechanism as the only way to search in the database. While unification can usually take effective advantage of hash-based indexing, it is often the case that queries over more complex and structured data, such as the vectorial terms stored in spatial databases, cannot.
We propose a new extension to Prolog indexing: User Defined Indexing (UDI). In this mechanism, the programmer may add extra information to Prolog indices so that only interesting fragments of the database will be selected. UDI provides a general extension of indexing, and can be used for both instantiated and constrained variables. As a test case, we demonstrate how UDI can be combined with a constraint system to provide an elegant and efficient mechanism to generate and execute range queries and spatial queries. Experimental evaluation shows that this mechanism can achieve orders of magnitude speedups on non-trivial datasets.
Unable to display preview. Download preview PDF.
- 1.Warren, D.H.D.: Implementing Prolog - Compiling Predicate Logic Programs. Technical Report 39 and 40, Department of Artificial Intelligence, University of Edinburgh (1977)Google Scholar
- 2.Warren, D.H.D.: An Abstract Prolog Instruction Set. Technical Note 309, SRI International (1983)Google Scholar
- 3.Hermenegildo, M., Bueno, F., Puebla, G.: The CIAO multi-dialect compiler and system: An experimentation workbench for future (C) LP systems. In: Parallelism and Implementation of Logic and Constraint Logic Programming (1999)Google Scholar
- 4.Puebla, G., Stuckey, P.: Optimization of logic programs with dynamic scheduling. In: Logic Programming: Proceedings of the Fourteenth International Conference on Logic Programming, MIT Press, Cambridge (1997)Google Scholar
- 5.Demoen, B., Mariën, A., Callebaut, A.: Indexing prolog clauses. In: NACLP, pp. 1001–1012 (1989)Google Scholar
- 6.Wielemaker, J.: SWI-Prolog 5.5: Reference Manual. SWI, University of Amsterdam, Roetersstraat 15, 1018 WB Amsterdam, The Netherlands (2008)Google Scholar
- 7.Santos Costa, V., Sagonas, K., Lopes, R.: Demand-driven indexing of prolog clauses. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 395–409. Springer, Heidelberg (2007)Google Scholar
- 9.Guttman, A.: R-trees: A dynamic index structure for spatial searching. In: Yormark, B. (ed.) SIGMOD 1984, Proceedings of Annual Meeting, Boston, Massachusetts, June 18-21, pp. 47–57. ACM Press, New York (1984)Google Scholar
- 10.The Postgis Development Team: Postgis adds support for geographic objects to the postgresql object-relational database, http://postgis.refractions.net/
- 13.Demoen, B.: Dynamic attributes, their hprolog implementation, and a first evaluation. Technical report, Department of Computer Science, K.U.Leuven, Leuven, Belgium (2002)Google Scholar