Evgeny Stanilovsky created IGNITE-18635:
-------------------------------------------

             Summary: Sql. Extra comparison in case of index scan and simple 
predicate.
                 Key: IGNITE-18635
                 URL: https://issues.apache.org/jira/browse/IGNITE-18635
             Project: Ignite
          Issue Type: Improvement
          Components: sql
    Affects Versions: 3.0.0-beta1
            Reporter: Evgeny Stanilovsky


IndexScanNode contains :

{noformat}
IgniteIndex schemaIndex
RangeIterable<RowT> rangeConditions
Predicate<RowT> filters
{noformat}

Seems that for some simple predicates no additional filters comparison is 
needed.
For example :

{noformat}
create table t (a int);
create index a_idx on t (a);
select a from t where a = 1;
{noformat}

If correct index scan is used here, no need in additional comparisons:

{noformat}
                    if (filters != null && !filters.test(row)) {
                        continue;
                    }
{noformat}

Seems for more complex cases: sort indexes and range this optimization still 
applicable:

{noformat}
create table t (a int);
create index a_idx on t (a);
select a from t where a > 5 and a < 10;
{noformat}



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

Reply via email to