Magic-sets transformation in nonrecursive systems
Ashish Kumar Gupta, Inderpal Singh Mumick · 1992
this paper we will write database queries in datalog [Ull89]. Datalog is the language of horn clause logic rules, written as "if-then" rules. A datalog rule is required to be range-restricted: it must define a finite relation for the predicate in the head of the rule. In this paper we will concentrate on nonrecursive queries. Mumick [Mum91] shows that nonrecursive datalog programs can be expressed in SQL using views, and that SQL queries can be expressed in datalog extended with duplicates and grouping with aggregation. Thus, the algorithms developed in this paper can be mapped to relational database systems having SQL as their query language. We will use dependency graphs to represent the dependence between predicates in a datalog program.