We present a wide-spectrum algebra and refinement calculus designed to allow one to reason about query optimization in graph-based data models. A query language is wide-spectrum if it can be used to express both user level queries as well as low-level evaluation strategies or access plans. This property enables rule-based query optimization to be viewed as the process of refining expressions in such a language: "non-procedural" sub-expressions are gradually replaced by more "procedural" sub-expressions until an unambiguous access plan results. We begin by presenting an algebra that is wide-spectrum in this sense. One subset of operations within the algebra can be used to define the formal semantics of a non-procedural query language for graph-based data models. Another subset can express common data access paradigms such as an index scan, the "cut" operator in Prolog or the nested-iteration join processing strategy. We then present a refinement calculus over the algebra which defines when one algebraic expression subsumes another. The calculus makes it possible to formally prove the correctness of rewrite rules used in rule-based query optimizers, and is sufficiently expressive to admit rules encoding many forms of semantic query optimization.
更多
查看译文
关键词
Query Optimization,Ground Rule,Interpretation Function,Finite List,Access Plan