Aleksey Plekhanov created IGNITE-21131:
------------------------------------------

             Summary: Calcite engine. OR operator with dynamic parameters can't 
be used for index scans
                 Key: IGNITE-21131
                 URL: https://issues.apache.org/jira/browse/IGNITE-21131
             Project: Ignite
          Issue Type: Improvement
            Reporter: Aleksey Plekhanov
            Assignee: Aleksey Plekhanov


Calcite can compose OR operator with literals to SEARCH/SARG, and SEARCH/SARG 
can be used for index scans. But we can't do this for OR operator with dynamic 
parameters. 

For example expression {{a IN (1, 2, 3)}} can be converted to {{a = 1 OR a = 2 
OR a = 3}} and after that can be converted to {{SEARCH(a, SARG(1, 2, 3))}}, but 
expression {{a IN (?, ?, ?)}} can be converted only to {{a = ? OR a = ? OR a = 
?}} and can't be used for index scan.

To fix this issue we can create ranges from dynamic parameters during planning, 
sort and remove intersections from these ranges in runtime.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to