An Empirical Evaluation of Cost-based Federated SPARQL Query Processing Engines

Umair Qudus, Muhammad Saleem, Axel-Cyrille Ngonga Ngomo, Young-koo LeearXiv 2021

TL;DR

This paper introduces novel "similarity error" metrics to evaluate the accuracy of cardinality estimators in cost-based federated SPARQL query engines. By benchmarking five state-of-the-art engines, the authors demonstrate that these new metrics are significantly better predictors of actual query runtime than traditional measures like q-error, providing a more precise tool for optimizing query planners.

What Problem Does This Paper Address?

Federated SPARQL query engines allow users to query data across multiple distributed sources as if they were a single database. To do this efficiently, "cost-based" engines use a query planner to predict the "cost" (usually based on the number of results, or cardinality) of different execution plans and pick the fastest one.

The challenge is that existing benchmarks typically focus on high-level outcomes like total runtime or result completeness. These metrics are "black boxes"—they don't explain why an engine is slow. Is it a network bottleneck, or did the query planner make a bad guess that led to a disastrous execution strategy? As shown in the motivating example below, even small estimation errors can lead an engine to choose a sub-optimal plan over an optimal one.

Figure 1: A motivating example showing how different cardinality estimates (Ce1 vs Ce2) lead to different query plans.

Prior to this work, there were no fine-grained metrics to specifically quantify the accuracy of these internal cardinality estimators and how their errors propagate to affect overall performance.

Methods

The authors propose a new set of metrics called Similarity Errors ($E_T$ for triple patterns, $E_J$ for joins, and $E_P$ for the overall query plan). Unlike the standard q-error—which only considers the maximum ratio between estimated and actual values—similarity errors use a normalized Euclidean distance approach. This makes them more robust against single outliers and better at capturing the cumulative quality of estimations across a complex query.

The study evaluates five prominent cost-based engines: CostFed, Odyssey, SemaGrow, LHD, and SPLENDID. The researchers:

  1. Calculated the accuracy of each engine's estimates for triple patterns and joins.
  2. Used linear and robust regression to correlate these errors with actual query runtimes.
  3. Categorized the resulting query plans as Optimal, Sub-optimal, or Only-plan (where only one join order is possible).

Datasets

The evaluation utilized LargeRDFBench, a billion-triple benchmark designed for federated SPARQL engines. It consists of:

  • 40 queries: Categorized into simple (S), complex (C), and complex high-source (CH) queries.
  • 13 real-world RDF datasets: Totaling approximately 34.3 GB of data.
  • This benchmark extends the well-known FedBench suite to provide more challenging scenarios for modern engines.

Key Insights and Ideas

  • Similarity Error is a Better Predictor: The proposed similarity metrics show a much stronger positive correlation with actual query runtimes than the traditional q-error. This makes them a more reliable diagnostic tool for engine developers.
  • The "Whole Plan" Matters Most: The error in the overall query plan ($E_P$) has the highest impact on runtime. If the engine miscalculates the total cost of the combined operations, performance suffers most acutely.
  • Triple Patterns are Fundamental: Errors in estimating individual triple patterns correlate more strongly with runtime than join errors. This suggests that improving basic pattern estimation is the most effective way to boost overall engine performance.
  • The "Only-plan" Trap: Many simple queries only have one logical execution path. In these cases, an engine might appear "fast" even if its internal estimator is highly inaccurate, because it didn't actually have a choice to make. This highlights the need for complex benchmarks to truly test a planner's "intelligence."

Key Results

  • CostFed was the overall winner, producing the fewest cardinality errors and the shortest execution times across the majority of queries.
  • Odyssey provides highly detailed statistics that lead to accurate join estimations, but it pays a heavy price: its index is massive (5.2 GB compared to CostFed's 10.5 MB) and takes over 86 hours to build.
  • Correlation Strength: Robust regression revealed that the similarity error of the overall query plan has a correlation coefficient ($R$) as high as 0.56 with runtime, whereas q-error often showed weak or even negative correlations.
  • Plan Quality: CostFed generated the highest number of optimal plans, while engines like SPLENDID and SemaGrow struggled with sub-optimal plans as query complexity increased.
Table 1: Comparison of metrics used in existing systems, highlighting the gap in cardinality estimation evaluation.

Limitations and Future Work

  • Odyssey's Practicality: While Odyssey's estimation logic is sophisticated, its massive index size makes it difficult to scale to "Big Data" RDF sets like Wikidata.
  • Network Assumptions: To isolate the planner's performance, the experiments were conducted in a local environment with negligible network costs. The authors acknowledge that real-world WAN latency might shift the importance of certain estimation errors.
  • Heuristics vs. Cost: Future work aims to compare these cost-based engines against "heuristic-based" (index-free) engines to quantify exactly how much performance gain is actually provided by maintaining a complex statistical index.

Summary updated

BibTeX
@misc{qudus2021empirical,
  author = {Umair Qudus and Muhammad Saleem and Axel-Cyrille Ngonga Ngomo and Young-koo Lee},
  title = {{An Empirical Evaluation of Cost-based Federated SPARQL Query Processing Engines}},
  year = {2021},
  eprint = {2104.00984},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.00984},
}
Figure