You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2021/03/03 20:50:00 UTC

[jira] [Updated] (IGNITE-14277) Calcite. Rewrite IN predicate to semi-join

     [ https://issues.apache.org/jira/browse/IGNITE-14277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Orlov updated IGNITE-14277:
--------------------------------------
    Summary: Calcite. Rewrite IN predicate to semi-join  (was: Calcite. )

> Calcite. Rewrite IN predicate to semi-join
> ------------------------------------------
>
>                 Key: IGNITE-14277
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14277
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Konstantin Orlov
>            Priority: Major
>
> Currently SqlToRelConverter rewrites queries with IN predicate into semi-join but without actually using semi-join. The resulting plan includes two joins and several aggregates over IN argument list to calculate some sort of indicators. This plan is quite cumbersome, it contains a lot of nodes, thus boost a search space.
> As workaround this optimization was disabled by increasing inSubQueryThreshold to a MAX_INT value.
> But a safer solution would be to rewrite the IN predicate as a true semi-join, or better yet, an inner join. To achieve this, we need to convert the list of values to an inline table with only single values as the left shoulder of the inner join, and place the original table as the right shoulder. Thus, we could take advantage of the Indexed Nested Loop in case there is an index on a column that is part of the IN predicate.
>  
> Starting point for this ticket is {{org.apache.calcite.sql2rel.SqlToRelConverter#substituteSubQuery}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)