## Join ordering for Constraint Handling Rules (2007)

### Cached

### Download Links

Venue: | In Djelloul, Duck et |

Citations: | 6 - 3 self |

### BibTeX

@INPROCEEDINGS{Koninck07joinordering,

author = {Leslie De Koninck and Jon Sneyers},

title = {Join ordering for Constraint Handling Rules},

booktitle = {In Djelloul, Duck et},

year = {2007}

}

### OpenURL

### Abstract

Abstract. Join ordering is the problem of finding cost optimal execution plans for matching multi-headed rules. In the context of Constraint Handling Rules, this topic has received limited attention so far, even though it is of great importance for efficient CHR execution. We present a formal cost model for joins and investigate the possibility of join optimization at runtime. We propose some heuristic approximations of the parameters of this cost model, for both the static and dynamic case. We discuss an O(n log n) optimization algorithm for the special case of acyclic join graphs. However, in general, join order optimization is an NP-complete problem. Finally, we identify some classes of cyclic join graphs that can be reduced to acyclic ones. 1

### Citations

481 | Access Path Selection in a Relational Database Management System
- Selinger, Astrahan, et al.
- 1979
(Show Context)
Citation Context ...otal EU Car Rental 5 4 2 (0) 5 (4) 2 (2) 18 (6) Hopcroft 10 9 4 (1) 1 (1) 24 (2) Monkey & Bananas 1 7 15 (7) 2 (0) 25 (7) RAM Simulator 1 2 3 (0) 5 (0) 2 (0) 13 (0) Timed Automaton 11 10 (9) 3 (3) 24 =-=(12)-=- Type Inference 26 48 13 (7) 6 (5) 4 (4) 97 (16) Well-founded Semantics 3 25 8 (1) 4 (2) 1 (1) 2 (2) 43 (6) Total 46 106 55 (25) 26 (15) 9 (7) 2 (2) 244 (49)Not every edge in a join graph has the sam... |

395 | Theory and practice of constraint handling rules
- Frühwirth
- 1998
(Show Context)
Citation Context ...general, join order optimization is an NP-complete problem. Finally, we identify some classes of cyclic join graphs that can be reduced to acyclic ones. 1 Introduction Constraint Handling Rules (CHR) =-=[4]-=- is a high-level language extension based on multi-headed guarded committed-choice rewrite rules. While originally designed for the implementation of constraint solvers, CHR is increasingly used as a ... |

285 |
An n log n algorithm for minimizing the states in a finite automaton
- Hopcroft
- 1971
(Show Context)
Citation Context ... for some example programs the number of n-headed rules (n ∈ [1..6]) and in between brackets the number of rules with cyclic join graphs. Name 1 2 3 4 5 6 Total EU Car Rental 5 4 2 (0) 5 (4) 2 (2) 18 =-=(6)-=- Hopcroft 10 9 4 (1) 1 (1) 24 (2) Monkey & Bananas 1 7 15 (7) 2 (0) 25 (7) RAM Simulator 1 2 3 (0) 5 (0) 2 (0) 13 (0) Timed Automaton 11 10 (9) 3 (3) 24 (12) Type Inference 26 48 13 (7) 6 (5) 4 (4) 97... |

120 | Optimization of nonrecursive queries
- Krishnamurthy, Boral, et al.
- 1986
(Show Context)
Citation Context ... We expand the comparison measure towards sequences: sequences s and t can be switched if and only if (JΘ = J n Θ ) Cs + |Js| · Ct ≤ Ct + |Jt| · Cs or, expressed in terms of ranks of sequences (as in =-=[7, 9]-=-): rank(s) = |Js| − 1 Cs ≤ |Jt| − 1 Ct = rank(t) Now, consider a head Hi whose direct parent H has a higher rank. We can show that only descendants of this parent are allowed between H and Hi. Assume ... |

67 | Heuristic and randomized optimization for the join ordering problem
- Steinbrunn, Moerkotte, et al.
- 1997
(Show Context)
Citation Context ...lternatives include applying the algorithm for acyclic join graphs to various spanning trees of the join graph [9, 14], and using randomized algorithms like simulated annealing and genetic algorithms =-=[13]-=-. Due to space considerations, we do not go into detail here. ⊓⊔6 Discussion 6.1 First-Few Answers As already pointed out in Section 3, our cost model is based on the assumption that all fireable rul... |

56 | The K.U.Leuven CHR system: Implementation and application
- Schrijvers, Demoen
- 2004
(Show Context)
Citation Context ...are forced to consider each instance of a constraint in the store. Modern CHR implementations employ various indexing schemes. We describe the indexing structures offered by the K.U.Leuven CHR system =-=[11]-=- which covers most of the indexing in other implementations as well. The K.U.Leuven CHR system offers the following indexing structures: – Hash table lookup for ground argument positions – Array looku... |

52 |
On the Optimal Nesting Order for Computing N-Relational Joins
- Ibaraki, Kameda
- 1984
(Show Context)
Citation Context ... We expand the comparison measure towards sequences: sequences s and t can be switched if and only if (JΘ = J n Θ ) Cs + |Js| · Ct ≤ Ct + |Jt| · Cs or, expressed in terms of ranks of sequences (as in =-=[7, 9]-=-): rank(s) = |Js| − 1 Cs ≤ |Jt| − 1 Ct = rank(t) Now, consider a head Hi whose direct parent H has a higher rank. We can show that only descendants of this parent are allowed between H and Hi. Assume ... |

48 | The refined operational semantics of Constraint Handling Rules
- Duck, Stuckey, et al.
- 2004
(Show Context)
Citation Context ...systems use a suboptimal join order motivate a closer investigation of the join ordering problem for CHR. ⊓⊔ This paper assumes a strong familiarity with CHR [4], the refined operational semantics ωr =-=[3]-=-, and optimizing CHR compilation [1, 10]. The rest of this paper is organized as follows. Section 2 gives a high level discussion of our approach. In Section 3, we give a generic cost model for comput... |

46 |
Analyses, optimizations and extensions of Constraint Handling Rules
- Schrijvers
- 2005
(Show Context)
Citation Context ...le originally designed for the implementation of constraint solvers, CHR is increasingly used as a general purpose programming language. Much work has been devoted to the optimized compilation of CHR =-=[1, 5, 10]-=-. A crucial aspect of CHR compilation is finding matching rules efficiently. Given an active constraint, searching for matching partner constraints corresponds to joining relations — a well-studied to... |

41 | Optimizing compilation of Constraint Handling Rules
- Holzbaur, Banda, et al.
- 2005
(Show Context)
Citation Context ...le originally designed for the implementation of constraint solvers, CHR is increasingly used as a general purpose programming language. Much work has been devoted to the optimized compilation of CHR =-=[1, 5, 10]-=-. A crucial aspect of CHR compilation is finding matching rules efficiently. Given an active constraint, searching for matching partner constraints corresponds to joining relations — a well-studied to... |

32 |
A polynomial time algorithm for optimizing join queries
- Swami, Iyer
- 1993
(Show Context)
Citation Context ...rd approach consists of applying an exponential algorithm based on dynamic programming. Alternatives include applying the algorithm for acyclic join graphs to various spanning trees of the join graph =-=[9, 14]-=-, and using randomized algorithms like simulated annealing and genetic algorithms [13]. Due to space considerations, we do not go into detail here. ⊓⊔6 Discussion 6.1 First-Few Answers As already poi... |

28 | Processing queries for the first few answers
- Bayardo, Miranker
- 1996
(Show Context)
Citation Context ...is assumed in the context of join order optimization for database systems. In the case of simplification or simpagation rules, it seems advantageous to optimize for finding the first full matches. In =-=[8]-=-, this topic is handled by taking into account the probability that a given partial match cannot be extended into a full match. We return to this issue in Section 6.1. 3.1 Notation Consider given an a... |

26 |
ECL i PS e : A platform for Constraint Logic Programming
- Wallace, Novello, et al.
- 1997
(Show Context)
Citation Context ...in Current CHR Implementations Current CHR implementations generally follow (a variation of) the HAL heuristic [5, 1], if they apply join ordering at all (e.g., Haskell CHR or the ECLiPSe ech library =-=[15]-=- use the textual order of heads). The K.U.Leuven CHR system uses a heuristic that was originally based on the HAL heuristic, but has become more complex over time due to incremental compiler changes. ... |

23 |
Compilation of Constraint Handling Rules
- Duck
- 2005
(Show Context)
Citation Context ...le originally designed for the implementation of constraint solvers, CHR is increasingly used as a general purpose programming language. Much work has been devoted to the optimized compilation of CHR =-=[1, 5, 10]-=-. A crucial aspect of CHR compilation is finding matching rules efficiently. Given an active constraint, searching for matching partner constraints corresponds to joining relations — a well-studied to... |

8 | Accurate functional dependency analysis for Constraint Handling Rules
- Duck, Schrijvers
(Show Context)
Citation Context ...rrence H0 of a rule with n remaining heads: H1, . . . , Hn. A join order Θ is a permutation of {0, 1, . . . , n} such that Θ(0) = 0. The matching is done by nested partner lookups in the order Θ(1), Θ=-=(2)-=-, . . . , Θ(n). We use the notation st(Hi) to denote all constraints (with identifier) in the CHR store which have the same constraint predicate as Hi. We use ¯ h to denote a tuple and hi to denote it... |

1 | 10. T. Schrijvers. Analyses, Optimizations and Extensions of Constraint Handling Rules - Schrijvers, Demoen - 1986 |