Skip to main content
QUICK REVIEW

[Paper Review] Towards Query Optimization for SPARQL Property Paths

Nikolay Yakovets, Parke Godfrey|arXiv (Cornell University)|Apr 30, 2015
Semantic Web and Ontologies19 references4 citations
TL;DR

This paper introduces Waveguide, a cost-based query optimization framework for SPARQL property paths that models a rich space of evaluation plans using finite automata and wavefronts. It demonstrates up to orders-of-magnitude performance improvements by leveraging optimizations like loop caching, delta pruning, and fpp (first-path pruning), showing that plan choice critically affects performance based on underlying graph structure.

ABSTRACT

The extension of SPARQL in version 1.1 with property paths offers a type of regular path query for RDF graph databases. Such queries are difficult to optimize and evaluate efficiently, however. We have embarked on a project, Waveguide, to build a cost-based optimizer for SPARQL queries with property paths. Waveguide builds a query plan - a waveguide plan (WGP) - which guides the query evaluation. There are numerous choices in the construction of a plan, and a number of optimization methods, meaning the space of plans for a query can be quite large. Execution costs of plans for the same query can vary by orders of magnitude. We illustrate the types of optimizations this approach affords and the performance gains that can be obtained. A WGP's costs can be estimated, which opens the way to cost-based optimization.

Motivation & Objective

  • To address the challenge of inefficient evaluation of SPARQL property path queries in RDF stores.
  • To design a comprehensive plan space—waveguide plans (WGPs)—that subsumes and extends existing approaches.
  • To enable cost-based optimization by modeling key cost factors such as intermediate result sizes and pruning efficiency.
  • To demonstrate that plan selection significantly impacts performance, necessitating data-aware optimization.

Proposed method

  • Proposes waveguide plans (WGPs) as a rich space of non-deterministic finite automata-based evaluation strategies for SPARQL property paths.
  • Models query evaluation as wavefront propagation, where each wavefront corresponds to a state in a finite automaton for the property path.
  • Introduces three key optimizations: loop caching to avoid redundant traversals, delta pruning to remove duplicate tuples early, and first-path pruning (fpp) to eliminate non-productive paths.
  • Employs a cost model estimating execution costs based on intermediate result sizes, label frequencies, and pruning effectiveness.
  • Uses dynamic enumeration to explore the WGP space and select the lowest-cost plan.
  • Validates the approach using real-world RDF datasets and compares performance across multiple query plans.

Experimental results

Research questions

  • RQ1How can we model a comprehensive and extensible space of evaluation plans for SPARQL property paths beyond existing approaches?
  • RQ2What cost factors most significantly influence the performance of property path evaluation plans?
  • RQ3To what extent can optimizations like loop caching, delta pruning, and fpp reduce execution time in practice?
  • RQ4How does the choice of waveguide plan affect performance across diverse graph structures and query patterns?
  • RQ5Can a cost-based optimizer outperform existing SPARQL engines like Jena and Virtuoso in real-world scenarios?

Key findings

  • Waveguide plans can achieve up to orders of magnitude better performance than naive or standard approaches, with one query showing a 1000x improvement.
  • The running time of plans correlates strongly with the number of edge walks and intermediate result sizes, especially when pruning is ineffective.
  • In queries with high redundancy (e.g., D1–D8), delta pruning significantly reduces cost by removing duplicate tuples early.
  • Lensing effects—where the focal point of pruning shifts based on label frequencies—can either increase or decrease pruning effectiveness, depending on the graph structure.
  • Combining multiple optimizations (cache, delta, fpp) in a single plan (e.g., P4) yields the best performance, with execution time reduced by over 90% compared to suboptimal plans.
  • The performance gap between best and worst plans is substantial (e.g., P1 vs. P4 in Q4), proving that plan selection is critical and must be cost-based.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.