Skip to content

Backjumping, yet and again #11

@Chat-Wane

Description

@Chat-Wane

Implement a generic BackendBackjumpingIterator, long overdue.

Let us consider the following query:

SELECT * WHERE {
  ?s p1 ?o .
  ?o p2 ?x .
  ?s p3 ?y }

The join order is that of the query. Sometimes, ?s p3 ?y may fail, yet the engine enumerates all bindings of ?o p2 ?x. It would be better to backjump [1] directly to the first triple pattern since the variable ?s is a probable cause of failure.

In terms of implementation, this means:

  • Throwing an exception in the has_next() with the incriminated variable and let the iterator that actually sets the variable catch it, so it can next() it accordingly.
  • For the sake of genericity, we must wrap each scan iterators into a backjump iterator that can throw, and make sure that every iterator properly forwards the exception.

This demonstrated remarkable performance improvements in compiled version of SPARQL queries, does this holds on the iterator/volcano model?


[1] R. J. Bayardo Jr., and D. P. Miranker. Processing Queries for First-Few Answers. In Proceedings of the fifth international conference on Information and knowledge management (1996).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions