You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2013/04/17 13:29:16 UTC

[jira] [Commented] (JENA-294) TransformFilterEquality does not handle starting OPTIONAL well

    [ https://issues.apache.org/jira/browse/JENA-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13633963#comment-13633963 ] 

Andy Seaborne commented on JENA-294:
------------------------------------

The form

SELECT *
{
   OPTIONAL { ?x :q ?o }
   FILTER(?x = :x)
   ?x :p ?o2
} 

is not safe to apply the filter equality rewrite.  It is a different query to 

SELECT *
{
   ?x :p ?o2
   OPTIONAL { ?x :q ?o }
   FILTER(?x = :x)
}

because  { OPTIONAL { ?x :q ?o } ...} may yield a row without ?x whereas
{ ?x :p ?o2 OPTIONAL { ?x :q ?o } ... } can't.

This is back to the original issue hence closing this JIRA.



                
> TransformFilterEquality does not handle starting OPTIONAL well
> --------------------------------------------------------------
>
>                 Key: JENA-294
>                 URL: https://issues.apache.org/jira/browse/JENA-294
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ, Optimizer
>    Affects Versions: Jena 2.7.4
>            Reporter: Simon Helsen
>         Attachments: filter-equality-13.rq, filter-equality-13.srj, jena-294-afs-1.patch, manifestPatchForOptFilterEquality.txt, patch.txt, patch.txt, test-filter-equality.zip
>
>
> There was one other case where our tests were stuck on a very slow query execution because transformFilterEquality failed to optimize. The problem is that the optimizer gives up whenever the WHERE clause starts with an OPTIONAL clause. The reason is that the generated algebraic formula starts with a TableUnit and this is not handled correctly. 
> I have attached a patch which fixes the problem

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira