Details

    • Type: New Feature
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Labels:
      None

      Description

      Our internal RDR benchmark revealed some potential for optimizing RDR query planning, in particular concerning the join order. As an example, take RDR query Q3:

      PREFIX wd: <http://www.wikidata.org/entity/>
      PREFIX wdo: <http://www.wikidata.org/ontology#>
      PREFIX prov: <http://www.w3.org/ns/prov#>
      SELECT ?property ?value ?reference WHERE {
        << wd:Q42 ?property ?value >> prov:wasDerivedFrom ?from .
        ?from wd:P248r ?reference .
        FILTER (?reference in (wd:Q5375741)) .
      }
      

      The plan shows that query evaluation starts with evaluating the simple pattern ??from wd:P247r ?reference?, with the FILTER attached, which seems to take up most of the time (actually, wd:Q5375741 should be inlined here, which would lead to a significant speedup I?d say, but that?s an orthogonal issue). For the SP version of the query (which is ~5x faster):

      PREFIX wd: <http://www.wikidata.org/entity/>
      PREFIX wdo: <http://www.wikidata.org/ontology#>
      PREFIX prov: <http://www.w3.org/ns/prov#>
      SELECT ?property ?value ?reference WHERE {
        ?sProp rdf:singletonPropertyOf ?property .
        wd:Q42 ?sProp ?value .
        ?sProp prov:wasDerivedFrom ?from .
        ?from wd:P248r ?reference .
        FILTER (?reference in (wd:Q5375741)) .
      }
      

      the evaluation plan starts with evaluating wd:Q42 ?sProp ?value, which seems to be superior/more selective.

      Similiar observations hold for other queries. The repeating pattern is that, in the RDR approach, non-reified patterns seem to be evaluated earlier than any reified patterns ? and this is not always the best approach. I?d guess this boils down to the join order optimizer.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            michaelschmidt michaelschmidt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: