Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-249 Implement spatial indices and support efficient spatial joins.
  3. BLZG-1635

Range scan optimization not working in context of multiple range restrictions

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: BLAZEGRAPH_2_0_0
    • Component/s: Query Engine
    • Labels:
      None

      Description

      When having multiple upper (or multiple lower) bounds in the query, the efficient range count mechanism is failing. As an example, consider the query

      SELECT * WHERE {
      
        hint:Group hint:optimizer "None" .  
      
        ?s <http://p> ?o .
        hint:Prior hint:rangeSafe "true" . 
        
        FILTER (?o>="0"^^xsd:integer && ?o<"10"^^xsd:integer)
                        
        <http://s5> <http://p> ?X .
        FILTER (?o < ?X ). 
      
      }
      

      over data

      <http://s0> <http://p> "0"^^xsd:integer .
      <http://s1> <http://p> "1"^^xsd:integer .
      <http://s2> <http://p> "2"^^xsd:integer .
      <http://s3> <http://p> "3"^^xsd:integer .
      ...
      <http://s15> <http://p> "15"^^xsd:integer .
      

      There are two upper bounds for ?o, namely the constant "5"^xsd:integer and the variable ?X. ?X is dynamically bound, so at evaluation time the optimizer doesn't know that ?X will be bound to 5 (which is ok). However, in that case the optimizer should use "10"^xsd:integer as an upper bound, which is not the case (in fact, only a lower bound is used for the query).

      The reason is that the ASTRangeOptimizer "composed" multiple range restrictions using MIN nodes. These MIN nodes, however, cannot be interpreted later on s.t. range restrictions are ignored.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: