grahamtriggs commented on issue #527: SDB Transform - improve performance of 
OPTIONAL, MINUS
URL: https://github.com/apache/jena/pull/527#issuecomment-462271798
 
 
   @afs Hi - I'm not entirely sure what you want as an example. To see what it 
is doing, this is the simplest form of query:
   
   ```
   SELECT ?sublect ?label
   WHERE {
     ?subject a  foaf:Person.
     OPTIONAL {
       ?subject rdfs:label ?label .
      }
   }
   ```
   
   which is transformed into the equivalent of
   
   ```
   SELECT ?sublect ?label
   WHERE {
     ?subject a  foaf:Person.
     OPTIONAL {
       ?subject a  foaf:Person.
       ?subject rdfs:label ?label .
      }
   }
   ```
   
   If you had a triple store that had a million rdfs:label assertions, but only 
50 of those applied to resources declared as being of type foaf:Person, there 
would be a substantial difference between the performance of these queries - 
certainly when using MySQL, where the second query would do an index join 
between the type / label, which is then applied to the outer join, rather than 
creating a temporary table of 1 million labels in the first query.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to