Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-745

Slow query with BIND

    XMLWordPrintable

    Details

      Description

      This was discussed in the Help forum:
      http://sourceforge.net/projects/bigdata/forums/forum/676946/topic/6873890

      A query that my application is using is taking a very long time (over a minute of CPU time) and eating lots of memory. The same query takes much less than a second on Fuseki, so I think there might be a problem somewhere. I'm using the stock configuration, except I've enabled quads mode and the text index (not used in the query). I'm running Bigdata inside Tomcat on Ubuntu 12.04 amd64.

      First, you can load the data I'm using into Bigdata using this SPARQL Update statement:

      LOAD <http://light.onki.fi/onki-light/rest/data/ysa> INTO GRAPH <http://www.yso.fi/onto/ysa>
      

      The dataset is a SKOS vocabulary with about 300k triples. You can get it from the above URL but I will also attach the file (ysa.rdf gzipped) to this ticket.

      Then run this query:

      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
       CONSTRUCT { 
        ?uri ?p ?o . 
        ?type rdfs:label ?typelabel . 
        ?uri skos:narrower ?n . 
        ?n a ?nt . 
        ?n skos:prefLabel ?nl . 
      } WHERE { 
        BIND ( <http://www.yso.fi/onto/ysa/Y141994> as ?uri ) 
        ?uri ?p ?o . 
        OPTIONAL { 
          ?uri a ?type . 
          ?type rdfs:label ?typelabel . 
        } 
        OPTIONAL { 
          ?n skos:broader ?uri . 
          ?n a ?nt . 
          ?n skos:prefLabel ?nl . 
        }
      }
      

      I will also attach the Explain result for the query to this ticket.

      It appears that Bigdata performs the BIND assignment very late in the query processing. Jena ARQ (in Fuseki) instead will do it first, saving lots of time.

      I tested both Bigdata 1.2.2 and the SVN head RELEASE_1_2_0 of yesterday. In both cases the result was similar.

      See BLZG-876, which may have the same underlying issue.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: