[
https://issues.apache.org/jira/browse/IGNITE-21372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maksim Zhuravkov updated IGNITE-21372:
--------------------------------------
Affects Version/s: (was: 3.0.0-beta2)
> Sql. Do not execute queries that guaranteed to return no results.
> -----------------------------------------------------------------
>
> Key: IGNITE-21372
> URL: https://issues.apache.org/jira/browse/IGNITE-21372
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Maksim Zhuravkov
> Priority: Minor
> Labels: ignite-3
>
> {code:java}
> sql("CREATE TABLE t2 (id INTEGER PRIMARY KEY, val INTEGER)");
> // query that always returns no data:
> sql("SELECT * FROM t2 WHERE id IS NULL");
> // Plan
> IgniteExchange(distribution=[single]): id = 28
> IgniteTableScan(table=[[PUBLIC, T2]], tableId=[8], *filters=[false]*,
> requiredColumns=[{0, 1}]): id = 25
> {code}
> Although the optimizer is able deduce that `id is NULL` is always false,
> since id is not nullable, and converted a predicate FALSE, the execution
> engine still runs such query.
> It is possible reduce plans that are guaranteed to produce no results to some
> form of empty plans, so that the execution engine won't run them and return
> an empty cursor instead.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)