Aleksey Plekhanov created IGNITE-15425:
------------------------------------------
Summary: Calcite engine. Add native support for SEARCH/SARG
operator
Key: IGNITE-15425
URL: https://issues.apache.org/jira/browse/IGNITE-15425
Project: Ignite
Issue Type: Improvement
Reporter: Aleksey Plekhanov
Currently, Calcite compose some field conditions to {{SEARCH/SARG}} operator
(for example: {{field IN (scalar)}}, {{field <> ...}}, {{field = value1 OR
field = value2}}, etc). This operator is not supported natively by Ignite
Calcite engine and converted back to original expression using
{{RexUtil.expandSearch}} method on theĀ {{RexToLixTranslator}} phase.
Such behavior forces Ignite to use full table scan instead of indexes in some
cases. For example, if {{field}} is indexed, with {{field IN (1, 2)}} condition
usually is much faster to scan index for 2 values, then full scan table and
filter out results. For {{OR}} operator {{OrToUnion}} rule can't be applied and
there will be full table scan again.
We should support index traversing using SEARCH/SARG operator.
Alternatively we can convert {{SEARCH/SARG}} to {{UNIONs}} (similarly to
{{OrToUnion}} rule), but this approach will extend plan search space a lot.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)