You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Yury Gerzhedovich (Jira)" <ji...@apache.org> on 2022/10/17 14:58:00 UTC

[jira] [Commented] (IGNITE-17820) Ignite 3. SQL. Add native support for SEARCH/SARG operator

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

Yury Gerzhedovich commented on IGNITE-17820:
--------------------------------------------

[~amashenkov] , LGTM

> Ignite 3. SQL. Add native support for SEARCH/SARG operator
> ----------------------------------------------------------
>
>                 Key: IGNITE-17820
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17820
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Andrey Mashenkov
>            Assignee: Andrey Mashenkov
>            Priority: Major
>              Labels: calcite, ignite-3
>             Fix For: 3.0.0-beta1
>
>
> 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.20.10#820010)