1. Introduction We assume the reader familiar with the basic concepts of refational databases (Ul] and with the logical query language for databases; using PROLOG's notation, described in [U2]. A database logic query is expressed as a triple <G ,LP ,D >, where G is a goal to be solved using the rules of the logic program LP and the facts of the relational database D. In thii paper, we study the problem of efficient implementations of queries on recur-sive rules without function symbols. We focus on an important subclass, called canonical strongly linear queries (CSL queries), and study the binding-passing property, which entails the propagation of the initial bindings (established by constants in the query goal) during the top-down (as in backward chaining) execution phase. The paper is organized as follows. In Section 2, we define CSL queries and study the binding propagation problem. In Section 3, we focus on l-bound CSL queries, where the binding propagates to a single (but not always the same)'argument of the recursive predicate. In Section 4, we study the problem of implementing these queries. We use a unifying framework to provide a simple description of the following four methods: the counting method (informally described in p+]), the eager method (similar to that in [HN]), the magic set method (presented in [B+]), and a new method here introduced, called magic counting, which combines the advantages of the first and the third. Extensions to and proofs of these results are given in [SZ].
[1]
Robert A. Kowalski,et al.
The Semantics of Predicate Logic as a Programming Language
,
1976,
JACM.
[2]
Lawrence J. Henschen,et al.
On compiling queries in recursive first-order databases
,
1984,
JACM.
[3]
J. D. Uiiman,et al.
Principles of Database Systems
,
2004,
PODS 2004.
[4]
David Harel,et al.
Horn clauses and the fixpoint query hierarchy
,
1982,
PODS.
[5]
David Maier,et al.
Magic sets and other strange ways to implement logic programs (extended abstract)
,
1985,
PODS '86.
[6]
Jeffrey D. Ullman,et al.
Implementation of logical query languages for databases
,
1985,
TODS.