Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18635

Sql. Extra comparison in case of index scan and simple predicate.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-beta1
    • None
    • sql

    Description

      IndexScanNode contains :

      IgniteIndex schemaIndex
      RangeIterable<RowT> rangeConditions
      Predicate<RowT> filters
      

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

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

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

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

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

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            zstan Evgeny Stanilovsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: