[ 
http://issues.apache.org/jira/browse/DERBY-772?page=comments#action_12363154 ] 

Satheesh Bandaram commented on DERBY-772:
-----------------------------------------

Ported this fix to 10.2, now that Dan's failing test case has been fixed for 
DERBY-649. 

Sending        java\engine\org\apache\derby\impl\sql\compile\PredicateList.java
Sending        java\engine\org\apache\derby\impl\sql\compile\SelectNode.java
Sending        java\engine\org\apache\derby\impl\sql\compile\UnionNode.java
Sending        
java\testing\org\apache\derbyTesting\functionTests\master\predicatesIntoViews.out
Sending        
java\testing\org\apache\derbyTesting\functionTests\tests\lang\predicatesIntoViews.sql
Transmitting file data .....
Committed revision 370254.

> Handle pushing IN predicates into UNIONs. This would allow use of index if 
> present improving performance.
> ---------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-772
>          URL: http://issues.apache.org/jira/browse/DERBY-772
>      Project: Derby
>         Type: Sub-task
>   Components: SQL
>     Versions: 10.0.2.0, 10.1.2.1, 10.2.0.0
>  Environment: generic
>     Reporter: Satheesh Bandaram
>      Fix For: 10.2.0.0, 10.1.2.2
>  Attachments: DERBY-772.patch
>
> While fix for DERBY-649 allows pushing binary predicates into SELECT 
> statements that are underneath a UNOIN, it would also be good to allow IN 
> operations to be pushed. Derby can rewrite IN operations in a way to allow 
> use of index, if present.
> Derby currently rewrites: REF IN (1, 2, 3) to REF >=1 and REF <=3 and hence 
> would allow use of index on REF, if present. Pushing this predicate into 
> Union would allow use of index on REF for queries like:
> Select * from 
>      (SELECT REF, NAME from T1 UNION ALL SELECT REF, NAME from t2)
> where REF IN (1,2,3)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to